Part Number Hot Search : 
LN513YKM VCO55CL 480T0 N5255 LB1247 57774S A1200 100PC
Product Description
Full Text Search
 

To Download SH7670 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  revision date: nov. 14 , 2007 32 SH7670 group hardware manual renesas 32-bit risc microcomputer superh tm risc engine family / SH7670 series SH7670 r5s76700 sh7671 r5s76710 sh7672 r5s76720 sh7673 r5s76730 rev.1.00 rej09b0437-0100 all information contained in this material, including products and product specifications at the time of publication of this material, is subject to change by renesas technology corp. without notice. please review the latest information published by renesas technology corp. through various means, including the renesas technology corp. website (http://www.renesas.com).
rev. 1.00 nov. 14, 2007 page ii of xxvi
rev. 1.00 nov. 14, 2007 page iii of xxvi 1. this document is provided for reference purposes only so that renesas customers may select the appropriate renesas products for their use. renesas neither makes warranties or representations with respect to the accuracy or completeness of the information contained in this document nor grants any license to any intellectual property rights or any other rights of renesas or any third party with respect to the information in this document. 2. renesas shall have no liability for damages or infringement of any intellectual property or other rights arising out of the use of any information in this document, including, but not limited to, product data, diagrams, charts, programs, algorithms, and application circuit examples. 3. you should not use the products or the technology described in this document for the purpose of military applications such as the development of weapons of mass destruction or for the purpose of any other military use. when exporting the products or technology described herein, you should follow the applicable export control laws and regulations, and procedures required by such laws and regulations. 4. all information included in this document such as product data, diagrams, charts, programs, algorithms, and application circuit examples, is current as of the date this document is issued. such information, however, is subject to change without any prior notice. before purchasing or using any renesas products listed in this document, please confirm the latest product information with a renesas sales office. also, please pay regular and careful attention to additional and different information to be disclosed by renesas such as that disclosed through our website. (http://www.renesas.com ) 5. renesas has used reasonable care in compiling the information included in this document, but renesas assumes no liability whatsoever for any damages incurred as a result of errors or omissions in the information included in this document. 6. when using or otherwise relying on the information in this document, you should evaluate the information in light of the total system before deciding about the applicability of such information to the intended application. renesas makes no representations, warranties or guaranties regarding the suitability of its products for any particular application and specifically disclaims any liability arising out of the application and use of the information in this document or renesas products. 7. with the exception of products specified by renesas as suitable for automobile applications, renesas products are not designed, manufactured or tested for applications or otherwise in systems the failure or malfunction of which may cause a direct threat to human life or create a risk of human injury or which require especially high quality and reliability such as safety systems, or equipment or systems for transportation and traffic, healthcare, combustion control, aerospace and aeronautics, nuclear power, or undersea communication transmission. if you are considering the use of our products for such purposes, please contact a renesas sales office beforehand. renesas shall have no liability for damages arising out of the uses set forth above. 8. notwithstanding the preceding paragraph, you should not use renesas products for the purposes listed below: (1) artificial life support devices or systems (2) surgical implantations (3) healthcare intervention (e.g., excision, administration of medication, etc.) (4) any other purposes that pose a direct threat to human life renesas shall have no liability for damages arising out of the uses set forth in the above and purchasers who elect to use renesas products in any of the foregoing applications shall indemnify and hold harmless renesas technology corp., its affiliated companies and their officers, directors, and employees against any and all damages arising out of such applications. 9. you should use the products described herein within the range specified by renesas, especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation characteristics, installation and other product characteristics. renesas shall have no liability for malfunctions or damages arising out of the use of renesas products beyond such specified ranges. 10. although renesas endeavors to improve the quality and reliability of its products, ic products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. please be sure to implement safety measures to guard against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a renesas product, such as safety design for hardware and software including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other applicable measures. among others, since the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or system manufactured by you. 11. in case renesas products listed in this document are detached from the products to which the renesas products are attached or affixed, the risk of accident such as swallowing by infants and small children is very high. you should implement safety measures so that renesas products may not be easily detached from your products. renesas shall have no liability for damages arising out of such detachment. 12. this document may not be reproduced or duplicated, in any form, in whole or in part, without prior written approval from renesas. 13. please contact a renesas sales office if you have any questions regarding the information contained in this document, renesas semiconductor products, or if you have any other inquiries. notes regarding these materials
rev. 1.00 nov. 14, 2007 page iv of xxvi general precautions in the handling of mpu/mcu products the following usage notes are applicable to all mpu/mcu products from renesas. for detailed usage notes on the products covered by this manual, refer to the rele vant sections of the manu al. if the descriptions under general precautions in the handling of mpu/mcu products and in the body of the manual differ from each other, the description in the bod y of the manual takes precedence. 1. handling of unused pins handle unused pins in accord with the directi ons given under handling of unused pins in the manual. ? the input pins of cmos products are general ly in the high-impedance state. in operation with an unused pin in the open-circuit state, extra electromagnetic noise is induced in the vicinity of lsi, an associated shoot-through cu rrent flows internally, and malfunctions occur due to the false recognition of the pin state as an input signal become possible. unused pins should be handled as described under handling of unused pins in the manual. 2. processing at power-on the state of the product is undefined at the moment when power is supplied. ? the states of internal circuits in the lsi are indeterminate and the states of register settings and pins are undefined at t he moment when power is supplied. in a finished product where the reset signal is applied to the external reset pin, the states of pins are not guaranteed from the moment when power is supplied until the reset process is completed. in a similar way, the states of pins in a pr oduct that is reset by an on-chip power-on reset function are not guaranteed from the moment when power is supplied until the power reaches the level at which resetting has been specified. 3. prohibition of access to reserved addresses access to reserved addresses is prohibited. ? the reserved addresses are provided for the po ssible future expansion of functions. do not access these addresses; the correct operat ion of lsi is not guaranteed if they are accessed. 4. clock signals after applying a reset, only release the reset line after the operating clock signal has become stable. when switching the clock signal during pr ogram execution, wait until the target clock signal has stabilized. ? when the clock signal is generated with an external resonator (or from an external oscillator) during a reset, ensure that the reset li ne is only released after full stabilization of the clock signal. moreover, when switching to a clock signal produced with an external resonator (or by an external oscillator) while program execution is in progress, wait until the target clock signal is stable. 5. differences between products before changing from one product to another, i. e. to one with a different type number, confirm that the change will not lead to problems. ? the characteristics of mpu/mcu in the same group but having different type numbers may differ because of the differences in internal memory capacity and layout pattern. when changing to products of different type numbers, implement a system-evaluation test for each of the products.
rev. 1.00 nov. 14, 2007 page v of xxvi how to use this manual 1. objective and target users this manual was written to explain the hardware functions and electrical characteristics of this lsi to the target users, i.e. those who will be using this lsi in the design of application systems. target users are expect ed to understand the fundamentals of electrical circuits, logic circuits, and microcomputers. this manual is organized in the following items: an overview of the product, descriptions of the cpu, system control functions, and periphera l functions, electrical characteristics of the device, and usage notes. when designing an application system that includ es this lsi, take all points to note into account. points to note are given in their contex ts and at the final part of each section, and in the section giving usage notes. the list of revisions is a summary of major points of revision or addition for earlier versions. it does not cover all revised items. for details on the revised points, see the actual locations in the manual. the following documents have been prepared for the SH7670 group. before using any of the documents, please visit our web site to verify that you have the most up-to-date available version of the document. document type contents document title document no. data sheet overview of hardware and electrical characteristics ? ? hardware manual hardware specifications (pin assignments, memory maps, peripheral specificat ions, electrical characteristics, and timing charts) and descriptions of operation SH7670 group hardware manual this manual software manual detailed descriptions of the cpu and instruction set sh-2a, sh-2a fpu software manual rej09b0051 application note exampl es of applications and sample programs renesas technical update preliminary report on the specifications of a product, document, etc. the latest versions are available from our web site.
rev. 1.00 nov. 14, 2007 page vi of xxvi 2. description of numbers and symbols aspects of the notations for register names, bit names, numbers, and symbolic names in this manual are explained below. cmcsr indicates compare match generation, enables or disables interrupts, and selects the counter input clock. generation of a wdtovf signal or interrupt initializes the tcnt value to 0. 14.3 operation the style "register name"_"instance number" is used in cases where there is more than one instance of the same function or similar functions. [example] cmcsr_0: indicates the cmcsr register for the compare-match timer of channel 0. in descriptions involving the names of bits and bit fields within this manual, the modules and registers to which the bits belong may be clarified by giving the names in the forms "module name"."register name"."bit name" or "register name"."bit name". (1) overall notation (2) register notation rev. 0.50, 10/04, page 416 of 914 14.2.2 compare match control/status register_0, _1 (cmcsr_0, cmcsr_1) 14.3.1 interval count operation (4) (3) (2) binary numbers are given as b'nnnn (b' may be omitted if the number is obviously binary), hexadecimal numbers are given as h'nnnn or 0xnnnn, and decimal numbers are given as nnnn. [examples] binary: b'11 or 11 hexadecimal: h'efa0 or 0xefa0 decimal: 1234 (3) number notation an overbar on the name indicates that a signal or pin is active-low. [example] wdtovf note: the bit names and sentences in the above figure are examples and have nothing to do with the contents of this manual. (4) notation for active-low when an internal clock is selected with the cks1 and cks0 bits in cmcsr and the str bit in cmstr is set to 1, cmcnt starts incrementing using the selected clock. when the values in cmcnt and the compare match constant register (cmcor) match, cmcnt is cleared to h'0000 and the cmf flag in cmcsr is set to 1. when the cks1 and cks0 bits are set to b'01 at this time, a f/4 clock is selected.
rev. 1.00 nov. 14, 2007 page vii of xxvi 3. description of registers each register description includes a bit chart, illu strating the arrangement of bits, and a table of bits, describing the meanings of the bit settings. the standard format and notation for bit charts and tables are described below. indicates the bit number or numbers. in the case of a 32-bit register, the bits are arranged in order from 31 to 0. in the case of a 16-bit register, the bits are arranged in order from 15 to 0. indicates the name of the bit or bit field. when the number of bits has to be clearly indicated in the field, appropriate notation is included (e.g., asid[3:0]). a reserved bit is indicated by " ? ". certain kinds of bits, such as those of timer counters, are not assigned bit names. in such cases, the entry under bit name is blank. (1) bit (2) bit name indicates the value of each bit immediately after a power-on reset, i.e., the initial value. 0: the initial value is 0 1: the initial value is 1 ? : the initial value is undefined (3) initial value for each bit and bit field, this entry indicates whether the bit or field is readable or writable, or both writing to and reading from the bit or field are impossible. the notation is as follows: r/w: r/(w): r: w: the bit or field is readable and writable. the bit or field is readable and writable. however, writing is only performed to flag clearing. the bit or field is readable. "r" is indicated for all reserved bits. when writing to the register, write the value under initial value in the bit chart to reserved bits or fields. the bit or field is writable. note: the bit names and sentences in the above figure are examples, and have nothing to do with the contents of this manual. (4) r/w describes the function of the bit or field and specifies the values for writing. (5) description bit 15 13 to 11 10 9 0 all 0 0 0 1 r r/w r r address identifier these bits enable or disable the pin function. reserved this bit is always read as 0. reserved this bit is always read as 1. ? asid2 to asid0 ? ? ? bit name initial value r/w description [bit chart] [table of bits] 14 1514131211109876543210 bit: initial value: r/w: 0000001000000000 r/w r/w r/w r/w r/w r r r/w r/w r/w r/w r/w r/w r/w r/w r/w ? asid2 ?????? acmp2 q ife ? asid1 asid0 acmp1 acmp0 ? 0 r (1) (2) (3) (4) (5) reserved these bits are always read as 0.
rev. 1.00 nov. 14, 2007 page viii of xxvi 4. description of abbreviations the abbreviations used in this manual are listed below. ? abbreviations specific to this product abbreviation description bsc bus controller cpg clock pulse generator dtc data transfer controller intc interrupt controller ? abbreviations other than those listed above abbreviation description acia asynchronous communications interface adapter bps bits per second crc cyclic redundancy check dma direct memory access dmac direct memory access controller gsm global system for mobile communications hi-z high impedance iebus inter equipment bus (iebus is a trademark of nec electronics corporation.) i/o input/output irda infrared data association lsb least significant bit msb most significant bit nc no connection pll phase-locked loop pwm pulse width modulation sfr special function register sim subscriber identity module uart universal asynchronous receiver/transmitter vco voltage-controlled oscillator all trademarks and registered trademarks ar e the property of th eir respective owners.
rev. 1.00 nov. 14, 2007 page ix of xxvi contents section 1 overview................................................................................................1 1.1 features....................................................................................................................... .......... 1 1.2 applications................................................................................................................... ....... 2 1.3 overview of specifications................................................................................................... 2 1.4 product lineup................................................................................................................. ... 12 1.5 block diagram.................................................................................................................. .. 14 1.6 pin assign ments ................................................................................................................ .15 1.7 pin functions .................................................................................................................. .... 16 section 2 cpu......................................................................................................29 2.1 register conf iguratio n........................................................................................................ 2 9 2.1.1 general registers................................................................................................ 29 2.1.2 control registers ................................................................................................ 30 2.1.3 system registers................................................................................................. 32 2.1.4 register banks .................................................................................................... 33 2.1.5 initial values of registers................................................................................... 33 2.2 data formats................................................................................................................... .... 34 2.2.1 data format in registers .................................................................................... 34 2.2.2 data formats in memory .................................................................................... 34 2.2.3 immediate data format ...................................................................................... 35 2.3 instruction features........................................................................................................... .. 36 2.3.1 risc-type instruction set.................................................................................. 36 2.3.2 addressing modes .............................................................................................. 40 2.3.3 instruction format............................................................................................... 45 2.4 instruction set ................................................................................................................ ..... 49 2.4.1 instruction set by classifica tion ......................................................................... 49 2.4.2 data transfer instructions................................................................................... 55 2.4.3 arithmetic operatio n instructions ...................................................................... 59 2.4.4 logic operation instructions .............................................................................. 62 2.4.5 shift instructions................................................................................................. 63 2.4.6 branch instructions ............................................................................................. 64 2.4.7 system control instructions................................................................................ 65 2.4.8 floating-point opera tion instru ctions................................................................. 67 2.4.9 fpu-related cpu instructions ........................................................................... 69 2.4.10 bit manipulation instructions ............................................................................. 70 2.5 processing states.............................................................................................................. ... 72
rev. 1.00 nov. 14, 2007 page x of xxvi section 3 floating-point unit (fpu)................................................................... 75 3.1 features....................................................................................................................... ........ 75 3.2 data formats................................................................................................................... .... 76 3.2.1 floating-point format......................................................................................... 76 3.2.2 non-numbers (nan) .......................................................................................... 79 3.2.3 denormalized numbers ...................................................................................... 80 3.3 register de scriptions.......................................................................................................... 81 3.3.1 floating-point registers ..................................................................................... 81 3.3.2 floating-point st atus/control regi ster (fpscr) ............................................... 82 3.3.3 floating-point communica tion register (fpul) ............................................... 83 3.4 rounding ....................................................................................................................... ..... 84 3.5 floating-point exceptions................................................................................................... 85 3.5.1 fpu exception sources ...................................................................................... 85 3.5.2 fpu exception handling .................................................................................... 86 section 4 cache ................................................................................................... 87 4.1 features....................................................................................................................... ........ 87 4.1.1 cache stru cture................................................................................................... 87 4.2 register de scriptions.......................................................................................................... 90 4.2.1 cache control regi ster 1 (ccr1) ...................................................................... 90 4.2.2 cache control regi ster 2 (ccr2) ...................................................................... 92 4.3 operation ...................................................................................................................... ...... 96 4.3.1 searching cache ................................................................................................. 96 4.3.2 read a ccess........................................................................................................ 98 4.3.3 prefetch operation (onl y for operan d cach e) ................................................... 98 4.3.4 write operation (only for operand cache) ....................................................... 99 4.3.5 write-back buffer (only for operand cache).................................................... 99 4.3.6 coherency of cache and external memory...................................................... 101 4.4 memory-mapped cache ................................................................................................... 102 4.4.1 address array................................................................................................... 102 4.4.2 data array ........................................................................................................ 103 4.4.3 usage examples................................................................................................ 105 4.4.4 notes................................................................................................................. 105 section 5 exception handling ........................................................................... 107 5.1 overview ....................................................................................................................... ... 107 5.1.1 types of exception hand ling and prio rity ....................................................... 107 5.1.2 exception handling operations........................................................................ 109 5.1.3 exception handling v ector table .................................................................... 111 5.2 resets......................................................................................................................... ....... 113
rev. 1.00 nov. 14, 2007 page xi of xxvi 5.2.1 input/output pins.............................................................................................. 113 5.2.2 types of reset .................................................................................................. 113 5.2.3 power-on reset ................................................................................................ 114 5.2.4 manual reset .................................................................................................... 116 5.3 address errors ................................................................................................................. .117 5.3.1 address error sources ...................................................................................... 117 5.3.2 address error excep tion handlin g ................................................................... 118 5.4 register bank errors......................................................................................................... 11 9 5.4.1 register bank er ror sources............................................................................. 119 5.4.2 register bank error exception hand ling ......................................................... 119 5.5 interrupts..................................................................................................................... ...... 120 5.5.1 interrupt sources............................................................................................... 120 5.5.2 interrupt priority level ..................................................................................... 121 5.5.3 interrupt exceptio n handling ........................................................................... 122 5.6 exceptions triggered by instruc tions ............................................................................... 123 5.6.1 types of exceptions trigge red by instru ctions ................................................ 123 5.6.2 trap instru ctions ............................................................................................... 124 5.6.3 slot illegal in structions ..................................................................................... 124 5.6.4 general illegal in structions............................................................................... 124 5.6.5 integer division instructions............................................................................. 125 5.6.6 floating-point operatio n instruction ................................................................ 126 5.7 when exception sources are not acce pted .................................................................... 127 5.8 stack status after exce ption handlin g ends..................................................................... 128 5.9 usage notes .................................................................................................................... .. 130 5.9.1 value of stack po inter (sp) .............................................................................. 130 5.9.2 value of vector base register (vbr) .............................................................. 130 5.9.3 address errors caused by stacking of address error exception handling ..... 130 section 6 interrupt controller (intc) ...............................................................131 6.1 features....................................................................................................................... ...... 131 6.2 input/output pins.............................................................................................................. 133 6.3 register desc riptions........................................................................................................ 13 4 6.3.1 interrupt priority registers 01, 02, 06 to 16 (ipr01, ipr02, ipr0 6 to ipr16) ...................................................................... 135 6.3.2 interrupt control regi ster 0 (i cr0).................................................................. 137 6.3.3 interrupt control regi ster 1 (i cr1).................................................................. 138 6.3.4 irq interrupt request re gister (irqrr)......................................................... 139 6.3.5 bank control regi ster (ibc r).......................................................................... 141 6.3.6 bank number regi ster (ibn r)......................................................................... 142 6.4 interrupt sources.............................................................................................................. .143
rev. 1.00 nov. 14, 2007 page xii of xxvi 6.4.1 nmi interrupt.................................................................................................... 143 6.4.2 user break interrupt ......................................................................................... 143 6.4.3 h-udi interrupt ................................................................................................ 143 6.4.4 irq interrupts................................................................................................... 144 6.4.5 on-chip peripheral mo dule interr upts ............................................................. 145 6.5 interrupt exception handling v ector table and priority.................................................. 146 6.6 operation ...................................................................................................................... .... 151 6.6.1 interrupt operati on sequence ........................................................................... 151 6.6.2 stack after interrupt ex ception hand ling ......................................................... 154 6.7 interrupt respon se time................................................................................................... 155 6.8 register banks ................................................................................................................. .161 6.8.1 banked register and input/ output of banks .................................................... 162 6.8.2 bank save and rest ore operations................................................................... 162 6.8.3 save and restore operations af ter saving to all banks................................... 164 6.8.4 register bank exception .................................................................................. 165 6.8.5 register bank error exception hand ling ......................................................... 165 6.9 data transfer with interr upt request si gnals................................................................... 166 6.9.1 handling interrupt request signals as sources for cpu interrupt but not dmac activat ing ........................................................ 167 6.9.2 handling interrupt request signals as sources for activating dmac but no t cpu interrupt ........................................................ 167 6.10 usage note ..................................................................................................................... .. 168 6.10.1 timing to clear an interrupt so urce ................................................................. 168 section 7 bus state controller (bsc) ............................................................... 169 7.1 features....................................................................................................................... ...... 169 7.2 input/output pins.............................................................................................................. 172 7.3 area overview.................................................................................................................. 174 7.3.1 address ma p..................................................................................................... 174 7.3.2 data bus width and pin functi on setting in e ach area .................................. 175 7.4 register desc riptions........................................................................................................ 17 6 7.4.1 common control regi ster (cmn cr) .............................................................. 177 7.4.2 csn space bus control register (csnbcr) (n = 0, 3 to 6) ............................. 179 7.4.3 csn space wait control register (c snwcr) (n = 0, 3 to 6) .......................... 184 7.4.4 sdram control regi ster (sd cr)................................................................... 205 7.4.5 refresh timer control/statu s register (r tcsr)............................................. 208 7.4.6 refresh timer coun ter (rtcnt)..................................................................... 210 7.4.7 refresh time constant register (rtcor) ...................................................... 211 7.4.8 ac characteristics switching register (acswr) ........................................... 212 7.4.9 ac characteristics switching ke y register (ackeyr) ................................. 213
rev. 1.00 nov. 14, 2007 page xiii of xxvi 7.4.10 sequence to write to acswr.......................................................................... 214 7.4.11 internal bus master bus prio rity register (ibmpr) ........................................ 215 7.5 operation ...................................................................................................................... .... 217 7.5.1 endian/access size and da ta alignment.......................................................... 217 7.5.2 normal space interface..................................................................................... 224 7.5.3 access wait control ......................................................................................... 229 7.5.4 csn assert period expansion ........................................................................... 231 7.5.5 sdram interface ............................................................................................. 232 7.5.6 sram interface with byte selection................................................................ 272 7.5.7 pcmcia inte rface............................................................................................ 277 7.5.8 wait between acce ss cycles ............................................................................ 284 7.5.9 others................................................................................................................ 290 section 8 direct memory access controller (dmac) .....................................293 8.1 features....................................................................................................................... ...... 293 8.2 input/output pins.............................................................................................................. 296 8.3 register desc riptions........................................................................................................ 29 7 8.3.1 dma source address re gisters (sar)............................................................ 301 8.3.2 dma destination address registers (d ar).................................................... 302 8.3.3 dma transfer count re gisters (dma tcr) ................................................... 302 8.3.4 dma channel control re gisters (c hcr) ....................................................... 303 8.3.5 dma reload source addres s registers (rsar) ............................................. 312 8.3.6 dma reload destination addr ess registers (rdar) ..................................... 313 8.3.7 dma reload transfer coun t registers (r dmatcr)..................................... 314 8.3.8 dma operation regist er (dmaor) ............................................................... 315 8.3.9 dma extension resource selectors 0 to 3 (dmars0 to dmars3).............. 319 8.4 operation ...................................................................................................................... .... 321 8.4.1 transfer flow.................................................................................................... 321 8.4.2 dma transfer requests ................................................................................... 323 8.4.3 channel prio rity................................................................................................ 327 8.4.4 dma transfer types........................................................................................ 330 8.4.5 number of bus cycles and dr eq pin sampling timing ................................ 339 section 9 clock pul se generator (cpg)............................................................343 9.1 features....................................................................................................................... ...... 343 9.2 input/output pins.............................................................................................................. 347 9.3 clock operating modes .................................................................................................... 349 9.4 register desc riptions........................................................................................................ 35 4 9.4.1 frequency control re gister (f rqcr).............................................................. 354 9.5 changing the frequency ................................................................................................... 357
rev. 1.00 nov. 14, 2007 page xiv of xxvi 9.5.1 changing the multip lication ra te ..................................................................... 357 9.5.2 changing the divi sion rati o............................................................................. 358 9.6 notes on boar d design ..................................................................................................... 359 9.6.1 note on inputting ex ternal cl ock ..................................................................... 359 9.6.2 note on using an external crystal reso nator .................................................. 359 9.6.3 note on resonator ............................................................................................ 360 9.6.4 note on using a pll os cillation circ uit.......................................................... 360 section 10 watchdog timer (wdt) ................................................................. 361 10.1 features....................................................................................................................... ...... 361 10.2 input/output pin ............................................................................................................... 362 10.3 register desc riptions........................................................................................................ 36 3 10.3.1 watchdog timer coun ter (wtcnt)................................................................ 363 10.3.2 watchdog timer control/statu s register (wtcsr)........................................ 364 10.3.3 watchdog reset control/sta tus register (wrcsr) ........................................ 366 10.3.4 notes on regist er access ................................................................................. 367 10.4 wdt usage ...................................................................................................................... 369 10.4.1 canceling software standby mode .................................................................. 369 10.4.2 changing the frequency ................................................................................... 369 10.4.3 using watchdog ti mer mode .......................................................................... 370 10.4.4 using interval timer mode .............................................................................. 372 10.5 usage notes .................................................................................................................... .. 373 10.5.1 timer variat ion ................................................................................................ 373 10.5.2 prohibition against settin g h'ff to wt cnt.................................................... 373 10.5.3 system reset by wdtovf signal................................................................... 373 10.5.4 manual reset in watchd og timer mode.......................................................... 374 section 11 power-down modes........................................................................ 375 11.1 features....................................................................................................................... ...... 375 11.1.1 power-down modes ......................................................................................... 375 11.2 register desc riptions........................................................................................................ 37 6 11.2.1 standby control regi ster (st bcr).................................................................. 377 11.2.2 standby control regist er 2 (st bcr2)............................................................. 378 11.2.3 standby control regist er 3 (st bcr3)............................................................. 380 11.2.4 standby control regist er 4 (st bcr4)............................................................. 382 11.2.5 system control regist er 1 (syscr1) .............................................................. 384 11.2.6 system control regist er 2 (syscr2) .............................................................. 386 11.2.7 system control regist er 3 (syscr3) .............................................................. 388 11.3 operation ...................................................................................................................... .... 389 11.3.1 sleep mode ....................................................................................................... 389
rev. 1.00 nov. 14, 2007 page xv of xxvi 11.3.2 software sta ndby mode .................................................................................... 390 11.3.3 software standby mode a pplication example................................................. 392 11.3.4 module standby function................................................................................. 393 11.4 usage notes .................................................................................................................... .. 394 section 12 ethernet controller (etherc)...........................................................395 12.1 features....................................................................................................................... ...... 395 12.2 input/output pins.............................................................................................................. 397 12.3 register desc ription ......................................................................................................... 39 9 12.3.1 etherc mode regi ster (ecm r)........................................................................ 400 12.3.2 etherc status regi ster (ecsr)......................................................................... 403 12.3.3 etherc interrupt permission register (e csipr) .............................................. 405 12.3.4 phy interface regist er (pir) ........................................................................... 406 12.3.5 mac address high re gister (m ahr)............................................................. 407 12.3.6 mac address low regi ster (malr).............................................................. 408 12.3.7 receive frame length register (rflr) .......................................................... 409 12.3.8 phy status regist er (psr)............................................................................... 410 12.3.9 transmit retry over counter register (trocr) ............................................ 411 12.3.10 delayed collision detect coun ter register (cdcr)........................................ 412 12.3.11 lost carrier counter register (lccr) ............................................................. 413 12.3.12 carrier not detect counte r register (cndcr) ............................................... 414 12.3.13 crc error frame counter re gister (cef cr).................................................. 415 12.3.14 frame receive error counte r register (frecr) ............................................. 416 12.3.15 too-short frame receive count er register (tsfrcr)................................... 417 12.3.16 too-long frame receive count er register (tlfrcr)................................... 418 12.3.17 residual-bit frame counte r register (rfcr) ................................................. 419 12.3.18 multicast address frame coun ter register (mafcr)..................................... 420 12.3.19 ipg register (ipgr) ......................................................................................... 421 12.3.20 automatic pause frame se t register (apr) ................................................. 422 12.3.21 manual pause frame set register (mpr) ..................................................... 423 12.3.22 pause frame retransfer count set register (t pauser)............................. 424 12.4 operation ...................................................................................................................... .... 425 12.4.1 transmissi on..................................................................................................... 425 12.4.2 reception .......................................................................................................... 427 12.4.3 mii frame timing ............................................................................................ 428 12.4.4 accessing mii re gisters ................................................................................... 430 12.4.5 magic packet de tection .................................................................................... 433 12.4.6 operation by ip g setting.................................................................................. 434 12.4.7 flow cont rol ..................................................................................................... 434 12.5 connection to phy-lsi.................................................................................................... 435
rev. 1.00 nov. 14, 2007 page xvi of xxvi 12.6 usage notes .................................................................................................................... .. 436 section 13 ethernet co ntroller direct memory access controller (e-dmac)........................................................ 437 13.1 features....................................................................................................................... ...... 437 13.2 register desc riptions........................................................................................................ 43 8 13.2.1 e-dmac mode regi ster (edm r) ................................................................... 439 13.2.2 e-dmac transmit request register (e dtrr) .............................................. 441 13.2.3 e-dmac receive request register (edrrr)................................................ 442 13.2.4 transmit descriptor list addr ess register (tdlar)...................................... 443 13.2.5 receive descriptor list addr ess register (rdlar) ....................................... 444 13.2.6 etherc/e-dmac status register (e esr)........................................................ 445 13.2.7 etherc/e-dmac status interrupt pe rmission register (eesipr)................... 450 13.2.8 transmit/receive status copy en able register (trscer)............................. 453 13.2.9 receive missed-frame counte r register (rmfcr) ........................................ 455 13.2.10 transmit fifo threshold register (tftr)...................................................... 456 13.2.11 fifo depth regist er (fdr) ............................................................................. 457 13.2.12 receiving method contro l register (rmcr) .................................................. 458 13.2.13 e-dmac operation contro l register (edocr) ............................................. 459 13.2.14 receiving-buffer write addre ss register (rbwar) ...................................... 460 13.2.15 receiving-descriptor fetch addr ess register (rdfar) ................................. 461 13.2.16 transmission-buffer read ad dress register (tbrar)................................... 461 13.2.17 transmission-descriptor fetch a ddress register (tdfar) ............................ 462 13.2.18 flow control fifo threshol d register (fcftr) ............................................ 462 13.2.19 receive data padding settin g register (rpadir) .......................................... 464 13.2.20 transmit interrupt regi ster (trimd) .............................................................. 465 13.2.21 checksum mode regi ster (csmr) .................................................................. 465 13.2.22 checksum skipped bytes monito r register (c ssbm ) ................................... 467 13.2.23 checksum monitor regi ster (cssmr) ............................................................ 468 13.3 operation ...................................................................................................................... .... 469 13.3.1 descriptor list and data buffers ...................................................................... 469 13.3.2 transmissi on..................................................................................................... 481 13.3.3 reception .......................................................................................................... 483 13.3.4 multi-buffer fram e transmit/receive processing ........................................... 485 13.3.5 padding receive data....................................................................................... 487 13.3.6 checksum calculati on function ....................................................................... 488 13.3.7 usage notes ...................................................................................................... 491
rev. 1.00 nov. 14, 2007 page xvii of xxvi section 14 dmac that work s with encryption/decryption and forward error correction core (a-dmac) ...........................493 14.1 overview....................................................................................................................... .... 493 14.1.1 features............................................................................................................. 493 14.1.2 overall configuration of the a-dmac............................................................ 494 14.1.3 restrictions on the a-dmac ........................................................................... 497 14.2 register desc riptions........................................................................................................ 49 8 14.2.1 channel [i] processing control re gister (c[i]c) (i = 0, 1) ............................... 499 14.2.2 channel [i] processing mode regi ster (c[i]m) (i = 0, 1) ................................. 502 14.2.3 channel [i] processing interrupt reques t register (c[i]i) (i = 0, 1) ................. 503 14.2.4 channel [i] processing descript or start address register (c[i]dsa) (i = 0, 1)........................................................................................... 505 14.2.5 channel [i] processing descriptor current address register (c[i]dca) (i = 0, 1) .......................................................................................... 506 14.2.6 channel [i] processing descriptor 0 regist er (c[i]d0) [control] (i = 0, 1)...... 507 14.2.7 channel [i] processing descriptor 1 register (c[i]d1) [source addres s] (i = 0, 1) ................................................................. 513 14.2.8 channel [i] processing descriptor 2 register (c[i]d2) [destination a ddress] (i = 0, 1)......................................................... 514 14.2.9 channel [i] processing descriptor 3 register (c[i]d3) [data length ] (i = 0, 1) ...................................................................... 514 14.2.10 channel [i] processing descriptor 4 register (c[i]d4) [checksum value write address] (i = 0, 1)....................................... 516 14.2.11 fec dmac processing cont rol register (fecc) ........................................... 516 14.2.12 fec dmac processing interrupt request register (feci)............................. 520 14.2.13 fec dmac processing descriptor st art address register (fecdsa)........... 523 14.2.14 fec dmac processing descriptor curr ent address register (fecdca) ..... 524 14.2.15 fec dmac processing descriptor 0 register (fecd00) [control] ............... 525 14.2.16 fec dmac processing descriptor 1 register (fecd01d0a) [destina tion address] .............................................................. 529 14.2.17 fec dmac processing descriptor 2 register (fecd02s0a) [sour ce 0 addre ss] ................................................................... 529 14.2.18 fec dmac processing descriptor 3 register (fecd03s1a) [sour ce 1 addre ss] ................................................................... 530 14.3 functions...................................................................................................................... ..... 531 14.3.1 dmac channel function ................................................................................. 532 14.3.2 checksum ......................................................................................................... 533 14.3.3 fec channel..................................................................................................... 533 14.3.4 fec operation .................................................................................................. 534
rev. 1.00 nov. 14, 2007 page xviii of xxvi 14.4 channel oper ation ............................................................................................................ 53 5 14.4.1 descriptor format............................................................................................. 535 14.4.2 basic channel op eration .................................................................................. 536 14.4.3 checksum ......................................................................................................... 537 14.5 fec channel op eration.................................................................................................... 539 14.5.1 descriptor format fo r fec channel................................................................. 539 14.5.2 basic fec channel operatio n .......................................................................... 540 section 15 stream interface (stif).................................................................. 543 15.1 features....................................................................................................................... ...... 543 15.2 input/output pins.............................................................................................................. 545 15.3 register desc riptions........................................................................................................ 54 6 15.3.1 stif mode select re gister (stmdr).............................................................. 547 15.3.2 stif control regist er (stctlr) .................................................................... 550 15.3.3 stif internal counter cont rol register (stcntcr) ...................................... 552 15.3.4 stif internal counter set register (stcntvr)............................................. 553 15.3.5 stif status regist er (ststr).......................................................................... 553 15.3.6 stif interrupt enable register (s tier) .......................................................... 556 15.3.7 stif transfer size register (stsizer) (n = 0,1) ........................................... 557 15.3.8 stifpwm mode regist er (stpwmmr) ........................................................ 558 15.3.9 stifpwm control regi ster (stp wmcr) ...................................................... 562 15.3.10 stifpwm register (stpwmr)...................................................................... 564 15.3.11 stifpcr0, stifpcr01 register s (stpcr0r, st pcr1r) ............................ 565 15.3.12 stifstc0, stifstc1 register s (ststc0r, ststc1r)............................... 566 15.3.13 stif lock control re gister (stlkcr)........................................................... 567 15.3.14 stif debugging status register (stdbgr) ................................................... 570 15.4 examples of clock connectio n to another device .......................................................... 570 15.4.1 a basic example .............................................................................................. 570 15.4.2 an example of clock connection when another device has no clock input...................................................... 570 15.4.3 an example of clock connection when another device has no clock ou tput ................................................... 571 15.5 input/output timing......................................................................................................... 571 15.6 pcr clock recovery module (p crrcv) ....................................................................... 578 15.6.1 operation of pcr cl ock recovery................................................................... 579 15.6.2 pcr clock recovery operation ....................................................................... 581
rev. 1.00 nov. 14, 2007 page xix of xxvi section 16 serial s ound interface (ssi) ............................................................585 16.1 features....................................................................................................................... ...... 585 16.2 input/output pins.............................................................................................................. 587 16.3 register desc ription ......................................................................................................... 58 8 16.3.1 control register (ssicr) ................................................................................. 589 16.3.2 status register (ssisr) .................................................................................... 595 16.3.3 transmit data regist er (ssitdr).................................................................... 600 16.3.4 receive data regist er (ssird r) ..................................................................... 600 16.3.5 ssi clock selection re gister (scsr)............................................................... 601 16.4 operation desc ription ....................................................................................................... 602 16.4.1 bus format........................................................................................................ 602 16.4.2 non-compressed modes................................................................................... 603 16.4.3 operation m odes............................................................................................... 613 16.4.4 transmit oper ation ........................................................................................... 614 16.4.5 receive operation............................................................................................. 617 16.4.6 temporary stop and restart proc edures in transmit mode ............................. 620 16.4.7 serial bit cloc k control.................................................................................... 621 16.5 usage notes .................................................................................................................... .. 622 16.5.1 limitations from overflow durin g receive dma operation........................... 622 section 17 usb 2.0 hos t/function module (usb) ...........................................623 17.1 features....................................................................................................................... ...... 623 17.2 input / outp ut pins............................................................................................................ 626 17.3 register desc ription ......................................................................................................... 62 8 17.3.1 system configuration contro l register (syscfg) ......................................... 635 17.3.2 cpu bus wait setting re gister (buswait) .................................................. 639 17.3.3 system configuration status register (s yssts)............................................. 640 17.3.4 device state control regi ster (dvstc tr) ..................................................... 642 17.3.5 test mode register (testmode) .................................................................. 648 17.3.6 dma-fifo bus configuration regi sters (d0fbcfg, d1fbcfg) ................ 651 17.3.7 fifo port registers (cfi fo, d0fifo, d1 fifo)............................................. 652 17.3.8 fifo port select registers (cfifo sel, d0fifosel, d1fifosel)............. 654 17.3.9 fifo port control registers (cfifoctr, d0fifoctr, d1fifoctr) ........ 661 17.3.10 interrupts enable regist er 0 (intenb0) ......................................................... 665 17.3.11 interrupt enable regist er 1 (intenb1) ........................................................... 667 17.3.12 brdy interrupt enable re gister (brdyenb) ............................................... 669 17.3.13 nrdy interrupt enable re gister (nrdyenb) ............................................... 671 17.3.14 bemp interrupt enable re gister (bem penb) ................................................ 673 17.3.15 sof control regist er (sofcfg) ..................................................................... 675
rev. 1.00 nov. 14, 2007 page xx of xxvi 17.3.16 interrupt status regist er 0 (intsts0) ............................................................. 677 17.3.17 interrupt status regist er 1 (intsts1) ............................................................. 682 17.3.18 brdy interrupt status re gister (brdysts).................................................. 688 17.3.19 nrdy interrupt status re gister (nrdysts) ................................................. 689 17.3.20 bemp interrupt status re gister (bempsts) .................................................. 691 17.3.21 frame number register (frmnum)............................................................... 692 17.3.22 frame number regist er (ufrmnum) ......................................................... 695 17.3.23 usb address register (usbaddr)................................................................ 696 17.3.24 usb request type regi ster (us breq) .......................................................... 697 17.3.25 usb request value regi ster (usbval) ........................................................ 699 17.3.26 usb request index regi ster (usbindx) ....................................................... 700 17.3.27 usb request length regi ster (usbleng) .................................................... 701 17.3.28 dcp configuration regi ster (dcpcfg).......................................................... 702 17.3.29 dcp maximum packet size re gister (dcpmaxp) ........................................ 703 17.3.30 dcp control regist er (dcpct r) .................................................................... 704 17.3.31 pipe window select re gister (pipesel)......................................................... 714 17.3.32 pipe configuration regi ster (pipecfg) .......................................................... 716 17.3.33 pipe buffer setting regi ster (pipebuf).......................................................... 723 17.3.34 pipe maximum packet size register (pipemaxp)......................................... 726 17.3.35 pipe timing control re gister (pipeperi)....................................................... 728 17.3.36 pipen control registers (pip enctr) (n = 1 to 9)........................................... 730 17.3.37 pipen transaction counter enable regi sters (pipentre) (n = 1 to 5)........... 750 17.3.38 pipen transaction counter register s (pipentrn) (n = 1 to 5) ...................... 752 17.3.39 device address n configuration regist ers (devaddn) (n = 0 to a)............. 754 17.3.40 bus wait register (d0f wait, d1fwait)..................................................... 757 17.4 operation ...................................................................................................................... .... 758 17.4.1 system control and os cillation cont rol ........................................................... 758 17.4.2 interrupt functions............................................................................................ 761 17.4.3 pipe control ...................................................................................................... 784 17.4.4 fifo buffer memory........................................................................................ 794 17.4.5 control transfer s (dcp)................................................................................... 804 17.4.6 bulk transfers (pipe1 to pipe5) ..................................................................... 808 17.4.7 interrupt transfers (pipe6 to pipe9) ............................................................... 810 17.4.8 isochronous transfers (pipe1 and pipe2) ....................................................... 811 17.4.9 sof interpolati on function .............................................................................. 823 17.4.10 pipe schedule.................................................................................................... 824 17.5 usage notes .................................................................................................................... .. 826 17.5.1 power supplies for th e usb modu le................................................................ 826 17.5.2 dtch interrupt ................................................................................................ 830
rev. 1.00 nov. 14, 2007 page xxi of xxvi section 18 sd host interface (sdhi)................................................................831 section 19 i 2 c bus interface 3 (iic3) ................................................................833 19.1 features....................................................................................................................... ...... 833 19.2 input/output pins.............................................................................................................. 835 19.3 register desc riptions........................................................................................................ 83 6 19.3.1 i 2 c bus control regist er 1 (iccr1 )................................................................. 836 19.3.2 i 2 c bus control regist er 2 (iccr2 )................................................................. 839 19.3.3 i 2 c bus mode regist er (icmr)........................................................................ 841 19.3.4 i 2 c bus interrupt enable register (i cier) ....................................................... 843 19.3.5 i 2 c bus status regi ster (icsr)......................................................................... 845 19.3.6 slave address regi ster (sar).......................................................................... 848 19.3.7 i 2 c bus transmit data re gister (icdrt)......................................................... 848 19.3.8 i 2 c bus receive data re gister (icd rr).......................................................... 849 19.3.9 i 2 c bus shift regist er (icdrs)........................................................................ 849 19.3.10 nf2cyc register (nf2cyc) .......................................................................... 850 19.4 operation ...................................................................................................................... .... 851 19.4.1 i 2 c bus format.................................................................................................. 851 19.4.2 master transmit operation ............................................................................... 852 19.4.3 master receive operatio n................................................................................. 854 19.4.4 slave transmit op eration ................................................................................. 856 19.4.5 slave receive op eration................................................................................... 859 19.4.6 clocked synchronous serial format................................................................. 860 19.4.7 noise filte r ....................................................................................................... 864 19.4.8 example of use................................................................................................. 865 19.5 interrupt reques ts ............................................................................................................. 869 19.6 bit synchronous circuit.................................................................................................... 870 19.7 usage notes .................................................................................................................... .. 873 19.7.1 notes on working in multi-master mode......................................................... 873 19.7.2 notes on working in ma ster receive mode..................................................... 873 19.7.3 notes on setting ackbt in master receive mode ......................................... 873 19.7.4 notes on the states of mst and trn bits when arbitration is lost ............... 874 section 20 host interface (hif).........................................................................875 20.1 features....................................................................................................................... ...... 875 20.2 input/output pins.............................................................................................................. 877 20.3 parallel access................................................................................................................ .. 878 20.3.1 operation .......................................................................................................... 878 20.3.2 connection me thod........................................................................................... 878 20.4 register desc riptions........................................................................................................ 87 9
rev. 1.00 nov. 14, 2007 page xxii of xxvi 20.4.1 hif index register (hifidx) .......................................................................... 880 20.4.2 hif general status re gister (hifgsr)............................................................ 882 20.4.3 hif status/control re gister (hifscr) ............................................................ 883 20.4.4 hif memory control re gister (hif mcr)....................................................... 886 20.4.5 hif internal interrupt cont rol register (hifiicr) .......................................... 888 20.4.6 hif external interrupt cont rol register (hifeicr) ........................................ 889 20.4.7 hif address regist er (hifadr) ..................................................................... 890 20.4.8 hif data register (hifdata) ........................................................................ 891 20.4.9 hif boot control re gister (h ifbcr).............................................................. 891 20.4.10 hifdreq trigger register (hifdtr)............................................................ 893 20.4.11 hif bank interrupt contro l register (h ifbicr)............................................. 894 20.5 memory map .................................................................................................................... 8 96 20.6 interface ...................................................................................................................... ...... 897 20.6.1 basic sequence ................................................................................................. 897 20.6.2 reading/writing of hif registers ot her than hifidx and hifidx ............... 898 20.6.3 consecutive data writing to hifr am by external device............................. 899 20.6.4 consecutive data reading from hi fram to external device ........................ 900 20.7 external dmac interface................................................................................................. 901 20.8 alignment co ntrol ............................................................................................................ 90 6 20.9 interface when external devi ce power is cu t off........................................................... 907 section 21 compare match timer (cmt) ........................................................ 911 21.1 features....................................................................................................................... ...... 911 21.2 register desc riptions........................................................................................................ 91 2 21.2.1 compare match timer start register (c mstr) .............................................. 913 21.2.2 compare match timer control/st atus register (cmcsr) .............................. 914 21.2.3 compare match coun ter (cmcnt) ................................................................. 916 21.2.4 compare match constant register (c mcor) ................................................. 916 21.3 operation ...................................................................................................................... .... 917 21.3.1 interval count operation .................................................................................. 917 21.3.2 cmcnt count timing..................................................................................... 917 21.4 interrupts..................................................................................................................... ...... 918 21.4.1 interrupt sources and dma transfer re quests ................................................ 918 21.4.2 timing of compare ma tch flag se tting ........................................................... 918 21.4.3 timing of compare matc h flag clearing......................................................... 919 21.5 usage notes .................................................................................................................... .. 920 21.5.1 conflict between write and compare- match processes of cmcnt ............... 920 21.5.2 conflict between word-write and count-up processes of cmcnt ............... 921 21.5.3 conflict between byte-write and c ount-up processes of cmcnt................. 922 21.5.4 compare match between cmcnt and cm cor ............................................ 922
rev. 1.00 nov. 14, 2007 page xxiii of xxvi section 22 serial communication interface with fifo (scif) ........................923 22.1 features....................................................................................................................... ...... 923 22.2 input/output pins.............................................................................................................. 925 22.3 register desc riptions........................................................................................................ 92 6 22.3.1 receive shift regi ster (scrs r)....................................................................... 928 22.3.2 receive fifo data re gister (scf rdr) .......................................................... 928 22.3.3 transmit shift regist er (sctsr) ..................................................................... 929 22.3.4 transmit fifo data re gister (scftdr) ......................................................... 929 22.3.5 serial mode regist er (scsmr)........................................................................ 930 22.3.6 serial control regi ster (scs cr)...................................................................... 933 22.3.7 serial status regi ster (scfsr) ........................................................................ 937 22.3.8 bit rate regist er (scbrr) .............................................................................. 945 22.3.9 fifo control regi ster (scf cr) ...................................................................... 952 22.3.10 fifo data count set re gister (scfdr) .......................................................... 955 22.3.11 serial port regist er (scsptr) ......................................................................... 956 22.3.12 line status regist er (sclsr) .......................................................................... 959 22.4 operation ...................................................................................................................... .... 960 22.4.1 overview........................................................................................................... 960 22.4.2 operation in asynch ronous mode .................................................................... 963 22.4.3 operation in clocked synchronous mode ........................................................ 974 22.5 scif inte rrupts ................................................................................................................ .983 22.6 usage notes .................................................................................................................... .. 984 22.6.1 scftdr writing and tdfe fl ag .................................................................... 984 22.6.2 scfrdr reading an d rdf flag ..................................................................... 984 22.6.3 break detection an d processing ....................................................................... 985 22.6.4 sending a break signal..................................................................................... 985 22.6.5 receive data sampling timi ng and receive margin (asynchronous mode) .. 985 section 23 pin functio n controller (pfc).........................................................987 23.1 register descriptions ...................................................................................................... 1003 23.1.1 port a i/o register h (paiorh) ................................................................... 1004 23.1.2 port a control registers h2 and h1 (pacrh2, pacrh1) .......................... 1005 23.1.3 port b i/o register l (pbiorl) .................................................................... 1008 23.1.4 port b control register l1 (pbcrl1) ........................................................... 1009 23.1.5 port c i/o registers h and l (pciorh, pciorl) ........................................ 1011 23.1.6 port c control registers h1, l2, and l1 (pccrh1, pccrl2, pccrl1) .... 1012 23.1.7 port d i/o register l (pdiorl) .................................................................... 1018 23.1.8 port d control register l1 (pdcrl1) ........................................................... 1019 23.1.9 port e i/o register l (peiorl) ..................................................................... 1021 23.1.10 port e control registers l2 and l1 (pecrl2, pecrl1) .............................. 1022
rev. 1.00 nov. 14, 2007 page xxiv of xxvi 23.1.11 port f i/o register l (pfiorl) ..................................................................... 1026 23.1.12 port f control registers l2 and l1 (pfcrl2, pfcrl1) .............................. 1027 23.1.13 port g i/o registers h and l (pgiorh, pgiorl) ....................................... 1031 23.1.14 port g control registers h2, l2, and l1 (pgcrh2, pgcrl2, pgcrl1) ... 1032 section 24 i/o ports......................................................................................... 1039 24.1 port a......................................................................................................................... ..... 1039 24.1.1 register desc riptions...................................................................................... 1039 24.1.2 port a data regist er h (padrh) .................................................................. 1040 24.2 port b......................................................................................................................... ..... 1042 24.2.1 register desc riptions...................................................................................... 1042 24.2.2 port b data regist er l (pbdrl) ................................................................... 1043 24.3 port c......................................................................................................................... ..... 1045 24.3.1 register desc riptions...................................................................................... 1045 24.3.2 port c data registers h an d l (pcdrh an d pcdrl) .................................. 1046 24.4 port d......................................................................................................................... ..... 1049 24.4.1 register desc riptions...................................................................................... 1049 24.4.2 port d data regist er l (pddr l)................................................................... 1050 24.5 port e ......................................................................................................................... ..... 1052 24.5.1 register desc riptions...................................................................................... 1052 24.5.2 port e data regist er l (ped rl).................................................................... 1053 24.6 port f ......................................................................................................................... ..... 1055 24.6.1 register desc riptions...................................................................................... 1055 24.6.2 port f data regist er l (pfd rl) .................................................................... 1056 24.7 port g......................................................................................................................... ..... 1058 24.7.1 register desc riptions...................................................................................... 1059 24.7.2 port g data registers h an d l (pgdrh and pgdrl).................................. 1059 section 25 user break controller (ubc)........................................................ 1063 25.1 features....................................................................................................................... .... 1063 25.2 register desc riptions...................................................................................................... 1065 25.2.1 break address regi ster (bar )....................................................................... 1066 25.2.2 break address mask re gister (b amr) ......................................................... 1067 25.2.3 break data regist er (bdr) ............................................................................ 1068 25.2.4 break data mask re gister (b dmr)............................................................... 1069 25.2.5 break bus cycle re gister (b br) ................................................................... 1070 25.2.6 break control regi ster (brc r) ..................................................................... 1072 25.3 operation ...................................................................................................................... .. 1074 25.3.1 flow of the user br eak operation .................................................................. 1074 25.3.2 break on instructio n fetch cy cle ................................................................... 1075
rev. 1.00 nov. 14, 2007 page xxv of xxvi 25.3.3 break on data a ccess cycl e........................................................................... 1076 25.3.4 value of saved prog ram counte r ................................................................... 1077 25.3.5 usage exam ples.............................................................................................. 1078 25.4 usage notes .................................................................................................................... 1081 section 26 high-performance u ser debugging interface (h-udi) ................1083 26.1 features....................................................................................................................... .... 1083 26.2 input/output pins............................................................................................................ 10 84 26.3 register desc riptions...................................................................................................... 1085 26.3.1 bypass register (sdbpr) .............................................................................. 1085 26.3.2 instruction regist er (sdir) ............................................................................ 1086 26.4 operation ...................................................................................................................... .. 1087 26.4.1 tap contro ller ............................................................................................... 1087 26.4.2 reset configur ation ........................................................................................ 1088 26.4.3 tdo output timing ....................................................................................... 1089 26.4.4 h-udi reset ................................................................................................... 1090 26.4.5 h-udi interrupt .............................................................................................. 1090 26.5 usage notes .................................................................................................................... 1091 section 27 on-chip ram ...............................................................................1093 27.1 features....................................................................................................................... .... 1093 27.2 usage notes .................................................................................................................... 1094 27.2.1 page conflict................................................................................................... 1094 27.2.2 rame and ramw e bits .............................................................................. 1094 section 28 list of registers .............................................................................1095 28.1 register addresses (by functional module, in order of the manual's sect ion numbers) ............................. 1096 28.2 register bits.................................................................................................................. .. 1114 28.3 register states in ea ch operating mode ........................................................................ 1157 section 29 electrical characteristics .................................................................1171 29.1 absolute maximu m ratings ........................................................................................... 1171 29.2 power-on/power-off sequence ....................................................................................... 1172 29.3 dc character istics .......................................................................................................... 117 3 29.4 ac character istics .......................................................................................................... 118 1 29.4.1 clock timing .................................................................................................. 1182 29.4.2 control signal timing .................................................................................... 1186 29.4.3 bus timi ng ..................................................................................................... 1187 29.4.4 dmac module timing .................................................................................. 1216
rev. 1.00 nov. 14, 2007 page xxvi of xxvi 29.4.5 watchdog time r timing ................................................................................ 1217 29.4.6 scif module timing...................................................................................... 1218 29.4.7 iic3 module timing....................................................................................... 1220 29.4.8 ssi module ti ming ........................................................................................ 1222 29.4.9 usb transceive r timing ................................................................................ 1225 29.4.10 sdhi module timing..................................................................................... 1227 29.4.11 i/o port ti ming............................................................................................... 1229 29.4.12 hif module signa l timing ............................................................................. 1230 29.4.13 etherc module si gnal timi ng........................................................................ 1233 29.4.14 h-udi related pi n timing ............................................................................. 1237 29.4.15 stif module signal timing (1 ) ..................................................................... 1239 29.4.16 stif module signal timing (2 ) ..................................................................... 1240 29.4.17 stif module signal timing (3) (with stream input/output set synchronized with stn_clkin rise time) 1241 29.4.18 stif module signal timing (4) (with stream input/output set synchronized with stn_clkin fall time). 1243 29.4.19 stif module signal timing (5) (with stream output set synchronized with stn_clkout rise time) ..... 1245 29.4.20 stif module signal timing (6) (with stream output set synchronized with stn_clkout fall time) ...... 1246 29.4.21 stif module signal timing (7 ) ..................................................................... 1247 29.4.22 ac characteristics measur ement condi tions ................................................. 1248 appendix ........................................................................................................... 1247 a. pin states ..................................................................................................................... ... 1247 b. product li neup................................................................................................................ 1 252 c. package dime nsions ....................................................................................................... 1253 index ................................................................................................................. 1255
section 1 overview rev. 1.00 nov. 14, 2007 page 1 of 1262 rej09b0437-0100 section 1 overview 1.1 features this lsi is a cmos single-chip microcontroller that integrates a renesas technology original risc (reduced instruction set computer) cpu core with peripheral functions required for an ethernet system. the cpu incorporated in this lsi is the sh-2a cpu, which features upward compatibility on the object code level with the sh-1 and sh-2 microcomputers. the cpu has a risc-type instruction set and employs a superscalar ar chitecture and the harvard archit ecture, which greatly improves instruction execution speed. in addition, the 32-bit internal-bus architecture enhances data processing power. this cpu realizes low-cost, high-performance, and high-functioning systems for applications such as high-speed realtime control, which was previously impossible with the conventional microcomputers. this lsi includes an ethernet controller (ether c) that incorporates a media access controller (mac) conforming to the ieee802.3u standard, which offers the lan connection in the rate of 10 or 100mbps. in addition, this lsi includes on -chip peripheral func tions required for systems, such as, cache memory, ram, a direct memory access controller (dmac), a host interfa ce (hif), an usb2.0 host/function module (usb), an sd host interface (sdhi), an interrupt controller (intc), a compare match timer (cmt), a se rial communication in terface with fifo (scif), and i/o ports. moreover, this lsi includes encryption functions (aes, des and 3des), message authentication code generating functions (hmac-sha-1, hmac-sha-224, and hmac-sha-256), an av stream interface (stif), and a serial sound inte rface (ssi), which can be applied to digital av equipment with network features. this lsi also provides an external memory access support function to enable direct connection to various memory devices or peripheral lsis. these on-chip functions significantly reduce costs of designing and manufacturing application systems.
section 1 overview rev. 1.00 nov. 14, 2007 page 2 of 1262 rej09b0437-0100 1.2 applications main applications: network application equipment, consumer equipment, digital av equipment 1.3 overview of specifications table 1.1 shows the overview of the specifications of this lsi. table 1.1 overview of sh 7670 group specifications classification module/function description on-chip ram ? ram size: 32 kbytes (four 8-kbyte banks) memory cache memory ? instruction cache: 8 kbytes ? operand cache: 8 kbytes ? 128-entry, 4-way set associative, 16-byte block length configuration each for the instruction cache and operand cache ? write-back, write-through and lru replacement algorithm ? cache locking function available (only for operand cache); ways 2 and 3 can be locked
section 1 overview rev. 1.00 nov. 14, 2007 page 3 of 1262 rej09b0437-0100 classification module/function description cpu cpu ? renesas technology original superh architecture ? compatible with sh-1, sh-2, and sh-2e at object code level ? 32-bit internal data bus ? general-register architecture ? sixteen 32-bit general registers ? four 32-bit control registers ? four 32-bit system registers ? register bank for high-speed response to interrupts ? risc-type instruction set (upward compatible with sh series) ? instruction length: 16-bit fixed-length basic instructions for improved code efficiency and 32-bit instructions for high performance and usability ? load/store architecture ? delayed branch instructions ? instruction set based on c language ? superscalar architecture to execute two instructions at one time including fpu ? instruction execution time: up to two instructions/cycle ? address space: 4 gbytes ? internal multiplier ? five-stage pipeline ? harvard architecture
section 1 overview rev. 1.00 nov. 14, 2007 page 4 of 1262 rej09b0437-0100 classification module/function description cpu floating-point unit (fpu) ? floating-point co-processor included ? supports single-precision (32-bit) and double-precision (64-bit) ? supports data type and exceptions that conform to ieee754 standard ? two rounding modes: round to nearest and round to zero ? denormalization modes: flush to zero ? floating-point registers ? sixteen 32-bit floating-point registers (single-precision 16 words or double-precision 8 words) ? two 32-bit floating-point system registers ? supports fmac (multiplication and accumulation) instructions ? supports fdiv (division) and fsqrt (square root) instructions ? supports fldi0/fldi1 (load c onstant 0/1) instructions ? instruction execution time latency (fmac/fadd/fsub/fmul): three cycles (single-precision), eight cycles (double-precision) pitch (fmac/fadd/fsub/fmul): one cycle (single- precision), six cycles (double-precision) note: fmac only supports single-precision. ? five-stage pipeline interrupts (sources) interrupt controller (intc) ? nine external interrupt pins (nmi and irq7 to irq0) ? on-chip peripheral interrupts: priority level set for each module ? sixteen priority levels available ? register bank enabling fast register saving and restoring in interrupt handling
section 1 overview rev. 1.00 nov. 14, 2007 page 5 of 1262 rej09b0437-0100 classification module/function description external bus extension bus state controller (bsc) ? address space for five areas (64 mbytes each) and 32-bit external bus ? the following features settable independently for each area: ? bus size: 8, 16, or 32 bits (depending on area) ? access wait cycle count ? idle wait cycle setting (same area/different area) ? supports sram, sram with byte selection, and sdram by specifying memory to be connected for each area ? supports the pcmcia interface ? chip select signal output to an applicable area (timings of cs asserting and negating are selectable by programming) ? sdram refreshing function ? supports auto-refreshing mode and self-refreshing mode ? sdram burst access function dma direct memory access controller (dmac) ? eight channels (external dma requests available for two of them) ? can be activated by on-chip peripheral modules ? burst mode and cycle steal mode ? supports intermittent mode (16 or 64 cycles) ? auto-reloading of transfer information
section 1 overview rev. 1.00 nov. 14, 2007 page 6 of 1262 rej09b0437-0100 classification module/function description clock pulse generator (cpg) ? clock mode: input clock can be selected from external input (extal or ckio) or cr ystal resonator (extal/xtal or usb_x1/usb_x2). ? three types of clocks generated ? cpu clock: ? 200 mhz (maximum) (regular specifications) ? 133 mhz (maximum) (wide temperature specifications) ? bus clock: ? 100 mhz (maximum) (regular specifications) ? 66 mhz (maximum) (wide temperature specifications) ? peripheral clock: ? 50 mhz (maximum) (regular specifications) ? 33 mhz (maximum) (wide temperature specifications) these maximum frequencies are target values that were set when we prepared this hardware manual. we will determine the guaranteed maximum frequencies after the final evaluation result of this lsi is obtained. clock power-down modes ? three power-down modes provided to reduce the current consumption in this lsi ? sleep mode ? software standby mode ? module standby mode compare match timer (cmt) ? two-channel 16-bit counter ? four types of clocks selectable (p /8, p /32, p /128, or p /512) ? generates a compare match interrupt timer watchdog timer (wdt) ? one-channel watchdog timer a counter overflow can reset this lsi
section 1 overview rev. 1.00 nov. 14, 2007 page 7 of 1262 rej09b0437-0100 classification module/function description ethernet controller (etherc) ? mac (media access control) function ? data frame assembly/dea ssembly (frame format conforming to ieee802.3) ? csma/cd link management (for collision avoidance and processing in case of collision) ? crc processing ? on-chip fifos (512 bytes for transmission and reception each) ? supports full-duplex data transmission and reception ? sends and receives short and long packets ? conforms to the mii (media independent interface) standard ? converts an 8-bit data stream from the mac layer to a 4-bit mii nibble stream ? station management (sta feature) ? eighteen ttl-level signals ? transfer rate: 10 or 100 mbps ? magic packet tm with wol (wake on lan) output advanced communication dmac for ethernet controller (e-dmac) ? reduces cpu load using the descriptor management system ? one channel for transfer from the etherc receive fifo to the receive buffer ? one channel for transfer from the transmit buffer to the etherc transmit fifo ? allows 16-byte burst transfer for efficient use of the system bus ? supports single frame and multibuffer ? calculates receive data checksum
section 1 overview rev. 1.00 nov. 14, 2007 page 8 of 1262 rej09b0437-0100 classification module/function description stream interface (stif) ? two-channel port in conjunction with a-dmac ? serial mode or parallel mode selectable for each channel ? supports mpeg2-ts and mpeg-ps transfer modes ? supports push-type transfer and pull-type transfer to each device ? external vco control pwm timer and its output provided for each channel ? stream clock output common to all channels and stream clock input for each channel serial sound interface (ssi) ? two-channel bidirectional serial transfer ? supports various serial audio formats ? supports master and slave functions ? generates programmable word clock and bit clock ? multichannel formats ? supports 8-, 16-, 18-, 20-, 22-, 24-, and 32-bit data formats usb2.0 host/function module (usb) ? conforms to usb version 2.0 ? supports three transfer rates: 480 mbps, 12 mbps, and 1.5 mbps ? software and functions switchable ? connectable to multiple peripheral devices through one- stage hub while the software is running ? software settable ? on-chip 8-kbyte ram as a communication buffer sd host interface (sdhi) (not supported in sh7672 and SH7670) ? sd memory/io card interfac e (1-bit/4-bit sd bus) ? error check functions: crc7 (for commands) and crc16 (for data) ? interrupt requests: card access interrupt, sdio access interrupt, and card detect interrupt ? dmac transfer requests: sd_buf write and sd_buf read ? supports card detection and write protection functions advanced interface i 2 c bus interface 3 (iic3) ? one channel ? on-chip master mode and slave mode
section 1 overview rev. 1.00 nov. 14, 2007 page 9 of 1262 rej09b0437-0100 classification module/function description host interface (hif) ? on-chip 4-kbyte buffer ram (two 2-kbyte banks) ? parallel connection of buffer ram and external device with sixteen data pins ? parallel connection of buffer ram and the cpu of this lsi with the internal bus ? a connected external device can access desired register after the register index was specified (however, addresses can be automatically updated during continuous buffer ram access) ? endian switchable ? an interrupt can be requested to a connected external device ? an internal interrupt can be requested to the cpu of this lsi ? allows booting from the buffer ram by storing the instruction code beforehand from the external device in the buffer ram advanced interface serial communication interface with fifo (scif) ? three channes ? clock synchronous mode or asynchronous mode selectable ? supports simultaneous transmission and reception (full- duplex communication) ? dedicated baud rate generator ? separate 16-byte fifo registers for transmission and reception ? modem control function (asynchronous mode)
section 1 overview rev. 1.00 nov. 14, 2007 page 10 of 1262 rej09b0437-0100 classification module/function description encryption functions (aes, des and 3des) (sh7671 and SH7670 support only dmac function. they do not support encryption function.) ? encryption/decryption engine can be activated by 2- channel dedicated dmac (a-dmac) or cpu ? by reading the descriptor usin g the a-dmac, continuous encryption/decryption availabl e by switching the source address (unprocessed data pointer), destination address (processed data storage address), and various settings (including encryption/decryption algorithm, encryption/decryption, ecb/ cbc/ofb, keys, and iv) in real time ? block-by-block encryption and decryption enabled by activation from the cpu message authentication code generating functions (hmac- sha-1, hmac- sha-224, and hmac-sha-256) (not supported in sh7671 and SH7670) ? by reading the descriptor us ing the a-dmac, generation of message authentication codes and checksum calculation in conjunctio n with encryption/decryption processing are available encryption, hash, and error correction forward error correction (fec) ? by reading the descriptor using the dedicated f-dmac, missing packets can be restored quickly by switching the source address (read packet pointer), destination address (restoration packet storage address), and packet size in real time ? arbitrary values can be used for the read packet pointer, read packet count, restoration packet storage address, and packet size user break controller (ubc) ? two break channels ? addresses, data values, type of access, and data size can be set as break conditions debugging function user debugging interface (h-udi) ? supports e10a emulator ? jtag-standard pin assignment ? supports boundary scan i/o ports ? eighty-six general input/output pins and eight general input pins ? input or output of i/o ports can be selected for each bit
section 1 overview rev. 1.00 nov. 14, 2007 page 11 of 1262 rej09b0437-0100 classification module/function description package ? p-fbga1717-256 (0.8 pitch) power supply voltage ? i/o: 3.3 (0.2) v, internal: 1.2 (0.1) v operating temperature (c) ? -20 to +70c (regualr specifications) ? -40 to +85c (wide temperature specifications) notes: * magic packet tm is a registered trademark of advanced micro devices, inc.
section 1 overview rev. 1.00 nov. 14, 2007 page 12 of 1262 rej09b0437-0100 1.4 product lineup table 1.2 lists the products and figure 1.1 shows how to read their type names. table 1.2 product lineup type name (abbreviation) rom size ram size package encryption sdhi remarks r5s76700 ? 32 kbytes p-fbga256 ?17 17 ?0.8 not mounted not mounted SH7670 r5s76710 ? 32 kbytes p-fbga256 ?17 17 ?0.8 not mounted mounted sh7671 r5s76720 ? 32 kbytes p-fbga256 ?17 17 ?0.8 mounted not mounted sh7672 r5s76730 ? 32 kbytes p-fbga256 ?17 17 ?0.8 mounted mounted sh7673 type name r: renesas semiconductor family package type bg bga product code maximum operating frequency 200: 200mhz 133: 133mhz characteristic code b: - 20?c to +70?c c: rom device type s romless classification 5 microcontroller r 5 s 76520 b 200 bg : : : - 40?c to +85?c figure 1.1 reading of type name ? small package package code body size pin pitch p-fbga256 ?17 17 ?0.8 prbg0256ga-a 17 17mm 0.8 mm
section 1 overview rev. 1.00 nov. 14, 2007 page 13 of 1262 rej09b0437-0100 1.5 block diagram t.b.d figure 1.2 block diagram 1.6 pin assignments 1 a b c d e f g h j k l m n p r t u v w 23456789101112131415161718 19 sh7673/sh7672/sh7671/SH7670 top view pa17/ a17 a00 pb04/ ce2a / irq2/ dack1 pb00/ wait / sda pb06/ cs4 we1 / dqmlu/ we d09 d12 d15 d05 d02 a16 a13 a10 a07 a04 cs3 ras cas pa18/ a18 pa20/ a20 pb05/ cs5 / ce1a / irq3/ tend1 pb02/ ce2b / irq0 rd pb07/ bs d08 d10 d14 d06 d03 d00 a14 a11 a08 a05 a02 a01 cke hifmd/ pa25/ a25 pa21/ a21 pa19/ a19 pb03/ cs6 / ce1b / irq1/ dreq1 pb01/ iois16 / scl cs0 we0 / dqmll d11 d13 d07 d04 d01 a15 a12 a09 a06 a03 rdwr ckio pc18/ lnksta pa24/ a24 pa22/ a22 vssq_14 vss_07 vccq_14 vcc_07 vssq_13 vccq_13 vccq_12 vssq_12 vcc_06 vss_06 vccq_11 vssq_11 vssq_10 we3 / dqmuu/ iciowr we2 / dqmul/ iciord d25 pc17/ mdc pc19/ exout pa23/ a23 vssq_00 vssq_09 d24 d26 d28 pc12/ tx_en pc13/ tx_clk pc20/ wol vccq_00 vccq_10 d27 d29 d30 pc06/ mii_txd2 pc07/ mii_txd3 pc16/ mdio vss_00 vccq_09 d31 d23 d22 pc15/ crs pc05/ mii_txd1 pc11/ tx_er vcc_00 vccq_08 vccq_07 d21 d20 pc10/ rx_clk pc14/ col pc04/ mii_txd0 vssq_01 vssq_08 vssq_07 d19 d18 pc08/ rx_dv pc03/ mii_rxd3 pc09/ rx_er vccq_01 vcc_05 d17 d16 pf07/ st0_d7/ ssiws0 pc02/ mii_rxd2 pc01/ mii_rxd1 pc00/ mii_rxd0 vccq_02 vss_05 pf06/ st0_d6/ ssidata0 pf05/ st0_d5/ rts0 pf04/ st0_d4/ cts0 testmd asemd pd07/ irq7 / sdclk vssq_02 vccq_06 pf03/ st0_d3/ sck0 pf02/ st0_d2/ rxd0 pf01/ st0_d1/ txd0 pd06/ irq6 / sdcmd pd05/ irq5 / sdcd pd04/ irq4 / sdwp vcc_01 vssq_06 pf10/ st0_syc/ dack0 pf09/ st0_vld/ dreq0 pf00/ st0_d0 pd03/ irq3 / sddat3 pd02/ irq2 / sddat2 pd01/ irq1 / sddat1 vcc_02 vcc_04 pf08/ st0_req st0_ clkin/ ssisck0 pf11/ st0_pwm/ tend0 pd00/ irq0 / sddat0 pg14/ hifd14 pg15/ hifd15 vss_04 wdtovf asebrk / asebrkak st0_ vco_ clkin pg12/ hifd12 pg13/ hifd13 pg11/ hifd11 vss_01 vssq_03 vssq_02 vccq_03 dg12 dv12 uv12 av12 vcc_03 vss_03 vccq_04 vccq_05 vssq_04 vssq_05 md_bw nmi vcc(pll) pg10/ hifd10 pg09/ hifd09 pg05/ hifd05 pg23/ hifcs pg22/ hifrs pg18/ hifdreq pg19/ hifint pg16/ hifebl ug12 ag12 pe04/ st1_d4/ cts1 pe01/ st1_d1/ txd1 pe09/ st1_vld/ sck2 st1_vco_ clkin/ audio_clk tck tdi md_ck1 md_ck0 extal pg08/ hifd08 pg06/ hifd06 pg04/ hifd04 pg01/ hifd01 pg21/ hifwr pg17/ hifrdy dg33 vbus ag33 pe06/ st1_d6/ ssidata1 usb_x1 pe07/ st1_d7/ ssiws1 pe03/ st1_d3/ sck1 pe10/ st1_syc/ cts2 pe11/ st1_pwm/ rts2 st1_ clkin/ ssisck1 res tdo xtal pg07/ hifd07 pg03/ hifd03 pg02/ hifd02 pg00/ hifd00 pg20/ hifrd dv33 dm dp av33 refrin usb_x2 pe05/ st1_d5/ rts1 pe02/ st1_d2/ rxd1 pe00/ st1_d0/ rxd2 pe08/ st1_req/ txd2 st_ clkout trst tms vss(pll) y 20 vssq vssq vssq vssq vssq vssq vssq vssq vssq vssq vssq vssq vssq vssq vssq vssq figure 1.3 pin assignments
section 1 overview rev. 1.00 nov. 14, 2007 page 14 of 1262 rej09b0437-0100 1.7 pin functions table 1.3 pin functions classification symbol i/o name function vcc i power supply power supply pin for the internal logic circuit. all the vcc pins must be connected to t he system power supply. this lsi does not operate correctly if there is a pin left open. vss i ground ground pin. all the vss pins must be connected to the syst em power supply (0 v). this lsi does not operate correctly if there is a pin left open. vccq i power supply power supply pin for i/o pins. all the vccq pins must be connected to the system power supply. this lsi does not operate correctly if there is a pin left open. power supply vssq i ground ground pin. all the vssq pins must be connected to the syst em power supply (0 v). this lsi does not operate correctly if there is a pin left open. extal i external clock pin connected to a crystal resonator. an external clock signal may also be input to the extal pin. xtal o crystal resonator pin connected to a crystal resonator clock ckio i/o system clock pin to supply the system clock to external devices md_bw i mode set pin to set the operating mode. do not change signal levels on this pin during operation. operating mode control md_ck1, md_ck0 i clock mode set pins to set the clock operating mode. do not change signal levels on these pins during operation. res i power-on reset this lsi enters the power-on reset state when this signal goes low. system control wdtovf o watchdog timer overflow an overflow signal from the wdt is output on this pin.
section 1 overview rev. 1.00 nov. 14, 2007 page 15 of 1262 rej09b0437-0100 classification symbol i/o name function nmi i non-maskable interrupt non-maskable interrupt request pin. fix it high when not in use. interrupts irq7 to irq0 i in terrupt requests 7 to 0 maskable interrupt request pins level-input or edge-input detection can be selected. when the edge-input detection is selected, the rising edge or falling edge can also be selected. address bus a25 to a00 o address bus addresses are output on these pins. data bus d31 to d00 i/o data bus bidirectional data bus pins cs0 , cs3 to cs6 o chip select 0, 3 to 6 chip-select signal pins for external memory or devices rd o read indicates that data is read from an external device. rd/ wr o read/write read/write signal pin bs o bus start bus cycle start signal pin we3 o most significant byte write indicates that data is written to data bits 31 to 24 of the external memory or device. we2 o second byte write indicates t hat data is written to data bits 23 to 16 of the external memory or device. we1 o third byte write indicates that data is written to data bits 15 to 8 of the external memory or device. we0 o least significant byte write indicates that data is written to data bits 7 to 0 of the external memory or device. wait i wait input pin to insert a wait cycle into bus cycles during access to the external space ras o ras pin connected to the ras pin of sdram cas o cas pin connected to the cas pin of sdram cke o clock enable pin connected to the cke pin of sdram bus control dqmuu o most significant byte select selects data bus bits 31 to 24 of sdram.
section 1 overview rev. 1.00 nov. 14, 2007 page 16 of 1262 rej09b0437-0100 classification symbol i/o name function dqmul o second byte select selects data bus bits 23 to 16 of sdram. dqmlu o third byte select selects data bus bits 15 to 8 of sdram. dqmll o least significant byte select selects data bus bits 7 to 0 of sdram. ce1a o pcmcia card select (lower) chip enable signal pin for pcmcia connected to area 5 ce1b o pcmcia card select (lower) chip enable signal pin for pcmcia connected to area 6 ce2a o pcmcia card select (upper) chip enable signal pin for pcmcia connected to area 5 ce2b o pcmcia card select (upper) chip enable signal pin for pcmcia connected to area 6 iciowr o pcmcia i/o write strobe pin connected to the pcmcia i/o write strobe iciord o pcmcia i/o read strobe pin connected to the pcmcia i/o read strobe we o pcmcia memory write strobe pin connected to the pcmcia memory write strobe bus control iois16 i pcmcia dynamic bus sizing indicates the 16-bit i/o of pcmcia in little-endian mode. fix this pin low in big-endian mode. dreq0, dreq1 i dma-transfer request input pins to receive external requests for dma transfer dack0, dack1 o dma-transfer request acknowledge output pins for signals indicating acknowledge of external requests from external devices direct memory access controller (dmac) tend0, tend1 o dma-transfer end output output pins for dma transfer end crs i carrier sense carrier sensing pin col i collision collision detecting pin mii_txd3 to mii_txd0 o transmit data 4-bit transmit data pins ethernet controller (etherc) tx_en o transmit enable indicates that transmit data is ready on the mii_txd3 to mii_txd0 pins.
section 1 overview rev. 1.00 nov. 14, 2007 page 17 of 1262 rej09b0437-0100 classification symbol i/o name function tx_clk i transmit clock input reference timing signal of tx_en, tx_er, and mii_txd3 to mii_txd0 tx_er o transmit error pin to notify the phy-lsi of an error detected during transmission mii_rxd3 to mii_rxd0 i receive data 4-bit receive data pins rx_dv i receive data valid indicates that valid receive data is present on the mii_rxd3 to mii_rxd0 pins rx_clk i receive clock input reference timing signal of rx_dv, rx_er, and mii_rxd3 to mii_rxd0 rx_er i receive error pin to recognize the state of an error detected during reception mdc o clock for management input reference timing signal of transfer data on the mdio pin mdio i/o management data i/o bidirectional pin to exchange management data wol o magic packet reception indicates that a magic packet tm * was received. lnksta i link status input pin to receive the link status signal from the phy-lsi ethernet controller (etherc) exout o general output external output pin st_clkout o data clock output pin st1_clkin, st0_clkin i data clock input pins st1_syc, st0_syc i/o synchronizing signal pins st1_req, st0_req i/o request signal pins st1_vld, st0_vld i/o data enable pins st1_d[7:0], st0_d[7:0] i/o data pins (the value 0 is used in serial mode) stream interface (stif) st1_vco_clkin, st0_vco_clkin i vcx0 clock pins
section 1 overview rev. 1.00 nov. 14, 2007 page 18 of 1262 rej09b0437-0100 classification symbol i/o name function stream interface (stif) st1_pwm, st0_pwm o pwm output pins ssidata1, ssidata0 i/o ssi data i/o serial data i/o pins ssisck1, ssisck0 i/o ssi clock i/o serial clock i/o pins ssiws1, ssiws0 i/o ssi clock lr i/o word select i/o pins serial sound interface (ssi) audio_clk i external clock for ssi audio the external clock for audio is input to this pin. dp i/o usb d+ data usb bus d+ data pin dm i/o usb d- data usb bus d- data pin vbus i vbus input connect this pin to vbus of the usb bus. refrin i reference input connect this pin to ag33 through a resistor of 5.6 k ? 1%. usb_x1 i usb_x2 o crystal resonator/external clock input for usb pins connected to the crystal resonator for usb. when an external clock is used, connect it to the usb_1 pin with the usb_2 pin open. av33 i analog power supply for transceiver power supply pin for the core (3.3 v (typ) supplied) ag33 i analog ground for transceiver ground pin for the core av12 i analog power supply for transceiver power supply pin for the core (1.2 v (typ) supplied) ag12 i analog ground for transceiver ground pin for the core dv33 i power supply for transceiver pins power supply pin for pins (3.3 v (typ) supplied) dg33 i ground for transceiver pins ground pin for transceiver pins usb2.0 host/function module (usb) dv12 i power supply for transceiver pins power supply pin for transceiver pins (1.2 v (typ) supplied)
section 1 overview rev. 1.00 nov. 14, 2007 page 19 of 1262 rej09b0437-0100 classification symbol i/o name function dg12 i ground for transceiver pins ground pin for transceiver pins uv12 i digital power supply for transceiver power supply pin for the core (1.2v (typ) supplied) usb2.0 host/function module (usb) ug12 i digital ground for transceiver ground pin for the core sdclk o sd clock sd clock output pin sdcmd i/o sd command sd command output/response input signal pin sddata3 to sddata0 i/o sd data sd data bus signal pins sdcd i sd card detect sd card detection pin sd host interface (sdhi) sdwp i sd write protect sd write protect signal pin scl i/o serial clock pi n serial clock i/o pin i 2 c bus interface 3 (iic3) sda i/o serial data pi n serial data i/o pin hifd15 to hifd00 i/o hif data bus hif address, data, and command i/o pins hifcs i hif chip select input pin to receive the hif chip select signal hifrs i hif register select pin for access type switching instruction to the hif hifwr i hif write write strobe signal pin hifrd i hif read read strobe signal pin hifint o hif interrupt pin to make an interrupt request from the hif to the external device hifmd i hif mode pin to specify hif boot mode hifdreq o hifdmac transfer request pin to request the external device for dma transfer to the hifram hifebl i hif pin enable a high-level input on this pin activates all the hif pins other than this pin. host interface (hif) hifrdy o hif boot ready indica tes that the hif module reset was canceled in this lsi and that accesses to the hif module from the external device are acceptable.
section 1 overview rev. 1.00 nov. 14, 2007 page 20 of 1262 rej09b0437-0100 classification symbol i/o name function txd2 to txd0 o transmit data transmit data pins rxd2 to rxd0 i receive data receive data pins sck2 to sck0 i/o serial clock clock input pins rts2 to rts0 o request to send modem control pins serial communication interface with fifo (scif) cts2 to cts0 i clear to send modem control pins pa25 to pa17 i/o general port 9-bit general i/o port pins pb07, pb05, pb04 i/o general port 3-bit general i/o port pins pb06, pb03 to pb00 i general port 5-bit general input port pins pc20 to pc01 i/o general port 20-bit general i/o port pins pc00 i general port 1-bit general input port pin pd07, pd06, pd03 to pd00 i/o general port 6-bit general i/o port pins pd05, pd04 i general port 2-bit general input port pins pe11 to pe00 i/o general port 12-bit general i/o port pins pf11 to pf00 i/o general port 12-bit general i/o port pins i/o ports pg23 to pg00 i/o general port 24-bit general i/o port pins tck i test clock test clock input pin tms i test mode select test mode selection signal input pin tdi i test data input serial input pin for instructions and data tdo o test data output serial output pin for instructions and data user debugging interface (h-udi) trst i test reset initialization signal input pin emulator interface asemd i ase mode pin to set ase mode a low-level input on this pin enables ase mode, and a high-level input enables normal mode. the emulator- specific functions are available in ase mode. test mode testmd i test mode pin to set test mode. a low-level input on this pin enables test mode. fix this input pin high. note: * magic packet tm is a registered trademark of advanced micro devices, inc.
section 1 overview rev. 1.00 nov. 14, 2007 page 21 of 1262 rej09b0437-0100 table 1.4 list of i/o attributes of each pin pin number function name i/o attribute a1 pa17/a17 io/o a2 a00 o a3 pb04/ ce2a /irq2/dack1 io/o/i/o a4 pb00/ wait /sda i/i/io a5 pb06/ cs4 i/o a6 we1 /dqmlu/ we o/o/o a7 d09 io a8 d12 io a9 d15 io a10 d05 io a11 d02 io a12 a16 o a13 a13 o a14 a10 o a15 a07 o a16 a04 o a17 a01 o a18 ras i a19 cas o a20 vssq power b1 pa19/a19 io/o b2 pa18/a18 io/o b3 pb05/ cs5 / ce1a /irq3/tend1 io/o/o/i/o b4 pb02/ ce2b /irq0 i/o/i b5 rd o b6 pb07/ bs io/o b7 d08 io b8 d10 io b9 d14 io b10 d06 io b11 d03 io
section 1 overview rev. 1.00 nov. 14, 2007 page 22 of 1262 rej09b0437-0100 pin number function name i/o attribute b12 d00 io b13 a14 o b14 a11 o b15 a08 o b16 a05 o b17 a02 o b18 cs3 o b19 v ss q power b20 cke o c1 pa22/a22 io/o c2 pa21/a21 io/o c3 pa20/a20 io/o c4 pb03/ cs6 / ce1b /irq1/dreq1 i/o/o/i/i c5 pb01/ iois16 /scl i/i/io c6 cs0 o c7 we0 /dqmll o/o c8 d11 io c9 d13 io c10 d07 io c11 d04 io c12 d01 io c13 a15 o c14 a12 o c15 a09 o c16 a06 o c17 a03 o c18 v ss q power c19 rdwr o c20 ckio io d1 hifmd/pa25/a25 i/io/o d2 pa24/a24 io/o d3 pa23/a23 io/o
section 1 overview rev. 1.00 nov. 14, 2007 page 23 of 1262 rej09b0437-0100 pin number function name i/o attribute d4 v ss q_14 power d5 v ss _07 power d6 v cc q_14 power d7 v cc _07 power d8 v ss q_13 power d9 v cc q_13 power d10 v cc q_12 power d11 v ss q power d12 v ss q _12 power d13 v cc _06 power d14 v ss _06 power d15 v cc q_11 power d16 v ss sq_11 power d17 v ss q_10 power d18 we3 /dqmuu/ iciowr o/o/o d19 we2 /dqmul/ iciord o/o/o d20 d25 io e1 pc18/lnksta io/o e2 pc19/exout io/o e3 pc20/wol io/o e4 v ss q_00 power e17 v ss q_09 power e18 d24 io e19 d26 io e20 d28 io f1 pc13/tx_clk io/i f2 pc16/mdio io/io f3 pc17/mdc io/i f4 v cc q_00 power f17 v cc q_10 power f18 d27 io f19 d29 io
section 1 overview rev. 1.00 nov. 14, 2007 page 24 of 1262 rej09b0437-0100 pin number function name i/o attribute f20 d30 io g1 pc07/mii_txd3 io/o g2 pc11/tx_er io/o g3 pc12/tx_en io/o g4 v ss _00 power g16 v cc q_09 power g17 d31 io g18 d23 io g19 d22 io h1 pc04/mii_txd0 io/o h2 pc05/mill_txd1 io/o h3 pc06/mii_txd2 io/o h4 v cc _00 power h17 v cc q_08 power h18 v cc q_07 power h19 d21 io h20 d20 io j1 pc10/rx_clk io/i j2 pc14/col io/i j3 pc15/crs io/i j4 v ss q_01 power j17 v ss q_08 power j18 v ss q_07 power j19 d19 io j20 d18 io k1 pc03/mii_rxd3 io/i k2 pc08/rx_dv io/i k3 pc09/rx_er io/i k4 v cc q_01 power k17 v cc _05 power k18 v ss q power k19 d17 io
section 1 overview rev. 1.00 nov. 14, 2007 page 25 of 1262 rej09b0437-0100 pin number function name i/o attribute k20 d16 io l1 pc00/mii_rxd0 i/i l2 pc01/mii_rxd1 io/i l3 pc02/mii_rxd2 io/i l4 v cc q_02 power l17 v ss _05 power l18 pf05/st0_d5/ rts0 io/io/io l19 pf06/st0_d6/ssidata0 io/io/io l20 pf07/st0_d7/ssiws0 io/io/io m1 testmd i m2 asemd i m3 pd07/ irq7 /sdclk io/i/o m4 v ss q power m17 v ss q power m18 pf02/st0_d2/rxd0 io/io/i m19 pf03/st0_d3/sck0 io/io/io m20 pf04/st0_d4/ cts0 io/io/io n1 pd04/ irq4 /sdwp i/i/i n2 pd05/ irq5 /sdcd i/i/i n3 pd06/ irq6 /sdcmd io/i/io n4 v ss q_02 power n17 v cc q_06 power n18 pf01/st0_d1/txd0 io/io/o n19 pf10/st0_syc/dack0 io/o/o n20 pf00/st0_d0 io/io p1 pd01 /irq1 /sddat1 io/i/i p2 pd02/ irq2 /sddat2 io/i/io p3 pd03 /irq3 /sddat3 io/i/io p4 v cc _01 power p17 v ss q_06 power p18 pf11/st0_pwm/tend0 io/o/o p19 pf08/st0_req io/io
section 1 overview rev. 1.00 nov. 14, 2007 page 26 of 1262 rej09b0437-0100 pin number function name i/o attribute p20 pf09_st0_vld/dreq0 io/io/i r1 pg14/hifd14 io/io r2 pg15/hifd15 io/io r3 pd00/ irq0 /sddat0 io/i/io r4 v cc _02 power r17 v cc _04 power r18 wdtovf o r19 st0_clkin/ssisck0 i/io r20 st0_vco_clkin i t1 pg11/hifd11 io/io t2 pg12/hifd12 io/io t3 pg13/hifd13 io/io t4 v ss _01 power t17 v ss _04 power t18 v ss q power t19 md_bw i t20 asebrk / asebrkak i/o u1 pg09/hifd09 io/io u2 pg10/hifd10 io/io u3 v ss q power u4 v ss _02 power u5 v ss q_03 power u6 v cc q_03 power u7 v ss q power u8 dg12 power u9 dv12 power u10 uv12 power u11 av12 power u12 v cc _03 power u13 v ss _03 power u14 v cc q_04 power u15 v cc q_05 power
section 1 overview rev. 1.00 nov. 14, 2007 page 27 of 1262 rej09b0437-0100 pin number function name i/o attribute u16 v ss q_04 power u17 v ss q _05 power u18 md_ck1 i u19 nmi i u20 v cc (pll) power v1 pg07/hifd07 io/io v2 v ss q power v3 pg04/hifd04 io/io v4 pg01/hifd01 io/io v5 pg22/hifrs io/i v6 pg17/hifrdy io/o v7 v ss q power v8 v ss q power v9 v ss q power v10 ug12 power v11 ag12 power v12 pe07/st1_d7/ssiws1 io/io/io v13 pe06/st1_d6/ssidata1 io/io/io v14 pe01/st1_d1/txd1 io/io/o v15 pe03/st1_d3/sck1 io/o/io v16 st1_vco_clkin/audio_clk i/i v17 tck i v18 tdi i v19 md_ck0 i v20 extal i w1 v ss q power w2 pg06/hifd06 io/io w3 pg03/hifd03 io/io w4 pg00/hifd00 io/io w5 pg21/ hifwr io/i w6 pg18/hifdreq io/o w7 pg16/hifebl io/i
section 1 overview rev. 1.00 nov. 14, 2007 page 28 of 1262 rej09b0437-0100 pin number function name i/o attribute w8 dg33 power w9 vbus i w10 ag33 power w11 v ss q power w12 usb_x1 i w13 pe05/st1_d5/ rts1 io/io/io w14 pe02/st1_d2/rxd1 io/io/i w15 pe10/st1_syc/ cts2 io/io/io w16 pe11/st1_pwm/ rts2 io/o/io w17 st1_clkin/ssisck1 i/io w18 res i w19 tdo o w20 xtal o y1 pg08/hifd08 io/io y2 pg05/hifd05 io/io y3 pg02/hifd02 io/io y4 pg23/ hifcs i/i y5 pg20/ hifrd io/i y6 pg19/ hifint io/o y7 dv33 power y8 dm io y9 dp io y10 av33 power y11 refrin i y12 usb_x2 o y13 pe04/st1_d4/ cts1 io/io/io y14 pe09/st1_vld/sck2 io/io/io y15 pe00/st1_d0/rxd2 io/io/i y16 pe08/st1_req/txd2 io/io/o y17 st_clkout o y18 trst i y19 tms i y20 v ss (pll) power
section 2 cpu rev. 1.00 nov. 14, 2007 page 29 of 1262 rej09b0437-0100 section 2 cpu 2.1 register configuration the register set consists of sixteen 32-bit general registers, four 32-bit control registers, and four 32-bit system registers. 2.1.1 general registers figure 2.1 shows the general registers. the sixteen 32-bit general register s are numbered r0 to r15. general registers are used for data processing and address calculation. r0 is also used as an index register. several instructions have r0 fixed as their only usable register. r15 is used as the hardware stack pointer (sp). saving and restoring the status register (sr) and program counter (pc) in exception handling is accomplished by referencing the stack using r15. 31 0 r0 * 1 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15, sp (hardware stack pointer) * 2 notes: 1. r0 functions as an index register in the indexed register indirect addressing mode and indexed gbr indirect addressing mode. in some instructions, r0 functions as a fixed source register or destination register. 2. r15 functions as a hardware stack pointer (sp) during exception processing. figure 2.1 general registers
section 2 cpu rev. 1.00 nov. 14, 2007 page 30 of 1262 rej09b0437-0100 2.1.2 control registers the control registers consist of four 32-bit registers: the status register (sr), the global base register (gbr), the vector base register (vbr ), and the jump table base register (tbr). the status register indicates instruction processing states. the global base register functions as a base ad dress for the gbr indirect addressing mode to transfer data to the registers of on-chip peripheral modules. the vector base register functions as the base address of the exception handling vector area (including interrupts). the jump table base register functions as the base address of the function table area. 31 0 1 t s 2 3 4 5 6 7 8 9 i[3:0] q m 13 14 cs bo status register (sr) 31 0 gbr global base register (gbr) 31 vbr vector base register (vbr) 0 31 tbr jump table base register (tbr) 0 figure 2.2 control registers (1) status register (sr) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 000000 - - 111100 - - r r/w r/w r r r r/w r/w r/w r/w r/w r/w r r r/w r/w bit: initial value: r/w: bit: initial value: r/w: ---------------- - bo cs - - - m q i[3:0] - - s t
section 2 cpu rev. 1.00 nov. 14, 2007 page 31 of 1262 rej09b0437-0100 bit bit name initial value r/w description 31 to 15 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 14 bo 0 r/w bo bit indicates that a register bank has overflowed. 13 cs 0 r/w cs bit indicates that, in clip instruction execution, the value has exceeded the saturation upper-limit value or fallen below the saturation lower-limit value. 12 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 m ? r/w 8 q ? r/w m bit q bit used by the div0s, div0u, and div1 instructions. 7 to 4 i[3:0] 1111 r/w interrupt mask level 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 s ? r/w s bit specifies a saturation operation for a mac instruction. 0 t ? r/w t bit true/false condition or carry/borrow bit (2) global base register (gbr) gbr is referenced as the base address in a gbr-referencing mov instruction. (3) vector base register (vbr) vbr is referenced as the branch destination ba se address in the event of an exception or an interrupt. (4) jump table base register (tbr) tbr is referenced as the start address of a function table located in memory in a jsr/n@@(disp8,tbr) table-referencing subroutine call instruction.
section 2 cpu rev. 1.00 nov. 14, 2007 page 32 of 1262 rej09b0437-0100 2.1.3 system registers the system registers consist of four 32-bit registers: the high and low multiply and accumulate registers (mach and macl), the procedure register (pr), and the program counter (pc). mach and macl store the results of multiply or multiply and accumulate operations. pr stores the return address from a subroutine procedure. pc indicates the program address being executed and controls the flow of the processing. 31 0 31 0 31 pc pr macl mach multiply and accumulate register high (mach) and multiply and accumulate register low (macl): store the results of multiply or multiply and accumulate operations. procedure register (pr): stores the return address from a subroutine procedure. program counter (pc): indicates the four bytes ahead of the current instruction. 0 figure 2.3 system registers (1) multiply and accumulate register high (mach) and multiply and accumulate register low (macl) mach and macl are used as the addition value in a mac instruction, and store the result of a mac or mul instruction. (2) procedure register (pr) pr stores the return address of a subroutine call using a bsr, bsrf, or jsr instruction, and is referenced by a subroutine return instruction (rts). (3) program counter (pc) pc indicates the address of th e instruction being executed.
section 2 cpu rev. 1.00 nov. 14, 2007 page 33 of 1262 rej09b0437-0100 2.1.4 register banks for the nineteen 32-bit registers comprising general registers r0 to r14, control register gbr, and system registers mach, macl, and pr, high-speed register saving and restoration can be carried out using a register bank. the register contents are automatically saved in the bank after the cpu accepts an interrupt that uses a register bank. re storation from the bank is executed by issuing a resbank instruction in an interrupt processing routine. this lsi has 15 banks. for details, see the sh-2a, sh2a-fpu software manual and section 6.8, register banks. 2.1.5 initial values of registers table 2.1 lists the values of the registers after a reset. table 2.1 initial values of registers classification register initial value r0 to r14 undefined general registers r15 (sp) value of the sta ck pointer in the vector address table sr bits i[3:0] are 1111 (h'f), bo and cs are 0, reserved bits are 0, and other bits are undefined gbr, tbr undefined control registers vbr h'00000000 mach, macl, pr undefined system registers pc value of the program counter in the vector address table
section 2 cpu rev. 1.00 nov. 14, 2007 page 34 of 1262 rej09b0437-0100 2.2 data formats 2.2.1 data format in registers register operands are always longwords (32 bits). if the size of memory operand is a byte (8 bits) or a word (16 bits), it is changed into a longword by expanding the sign-part when loaded into a register. 31 0 longword figure 2.4 data format in registers 2.2.2 data formats in memory memory data formats are classifi ed into bytes, words, and longwords. memory can be accessed in 8-bit bytes, 16-bit words, or 32-bit longwords. a memory operand of fewer than 32 bits is stored in a register in sign-extended or zero-extended form. a word operand should be accessed at a word boundary (an even address of multiple of two bytes: address 2n), and a longword operand at a longword boundary (an even address of multiple of four bytes: address 4n). otherwise, an address error will occur. a byte operand can be accessed at any address. only big-endian byte order can be selected for the data format. data formats in memory are shown in figure 2.5. 31 0 15 23 7 byte byte byte byte word word address 2n address 4n longword address m address m + 2 address m + 1 address m + 3 big endian figure 2.5 data formats in memory
section 2 cpu rev. 1.00 nov. 14, 2007 page 35 of 1262 rej09b0437-0100 2.2.3 immediate data format byte (8-bit) immediate data is located in an instruction code. immediate data accessed by the mov, add, and cmp/eq instructions is sign-extended and handled in registers as longword data. immediate data accessed by the tst, and, or, and xor instructions is zero-extended and handled as longword data. consequently, and instructions with immediate data always clear the upper 24 bits of the destination register. 20-bit immediate data is located in the code of a movi20 or movi20s 32-bit transfer instruction. the movi20 instruction stores immediate data in the destination register in sign-extended form. the movi20s instruction shifts immediate data by eight bits in the upper direction, and stores it in the destination register in sign-extended form. word or longword immediate data is not located in the instruction code, but rather is stored in a memory table. the memory table is accessed by an immediate data transfer instruction (mov) using the pc relative addressi ng mode with displacement. see examples given in section 2.3.1 (10), immediate data.
section 2 cpu rev. 1.00 nov. 14, 2007 page 36 of 1262 rej09b0437-0100 2.3 instruction features 2.3.1 risc-type instruction set instructions are risc type. this section details their functions. (1) 16-bit fixed-length instructions basic instructions have a fixed length of 16 bits, improving program code efficiency. (2) 32-bit fixed-length instructions the sh-2a additionally features 32-bit fixed-length instructions, improving performance and ease of use. (3) one instruction per state each basic instruction can be executed in one cycle using the pipeline system. (4) data length longword is the standard data length for all operations. memory can be accessed in bytes, words, or longwords. byte or word data in memory is sign-extended and handled as longword data. immediate data is sign-extended for arithmetic operations or zero-extended for logic operations. it is also handled as longword data. table 2.2 sign extension of word data sh2-a cpu description example of other cpu mov.w @(disp,pc),r1 add r1,r0 ......... .data.w h'1234 data is sign-extended to 32 bits, and r1 becomes h'00001234. it is next operated upon by an add instruction. add.w #h'1234,r0 note: @(disp, pc) accesses the immediate data. (5) load-store architecture basic operations are executed between registers. for operations that involve memory access, data is loaded to the registers and executed (load-stor e architecture). instructio ns such as and that manipulate bits, however, are executed directly in memory.
section 2 cpu rev. 1.00 nov. 14, 2007 page 37 of 1262 rej09b0437-0100 (6) delayed branch instructions with the exception of some instructions, uncond itional branch instructions, etc., are executed as delayed branch instructions. with a delayed branch instruction, the branch is taken after execution of the instruction immediately following the delayed branch instruction. this reduces disturbance of the pipeline control when a branch is taken. in a delayed branch, the actual branch operation occurs after execution of the slot instruction. however, instruction execution such as register up dating excluding the actual branch operation, is performed in the order of delayed branch instruction delay slot instruction. for example, even though the contents of the register holding the br anch destination address are changed in the delay slot, the branch destination address remains as the register contents prior to the change. table 2.3 delayed branch instructions sh-2a cpu description example of other cpu bra trget add r1,r0 executes the add before branching to trget. add.w r1,r0 bra trget (7) unconditional branch instructions with no delay slot the sh-2a additionally features unconditional branch instructions in which a delay slot instruction is not executed. this eliminates unn ecessary nop instructions, and so reduces the code size. (8) multiply/multiply-and- accumulate operations 16-bit 16-bit 32-bit multiply operations are executed in one to two cycles. 16-bit 16-bit + 64-bit 64-bit multiply-and-accumulate operations are executed in tw o to three cycles. 32-bit 32-bit 64-bit multiply and 32-bit 32-bit + 64-bit 64-bit multiply-and-accumulate operations are executed in two to four cycles. (9) t bit the t bit in the status register (sr) changes acco rding to the result of the comparison. whether a conditional branch is taken or not taken depends upon the t bit condition (true/false). the number of instructions that change the t bit is kept to a minimum to improve the processing speed.
section 2 cpu rev. 1.00 nov. 14, 2007 page 38 of 1262 rej09b0437-0100 table 2.4 t bit sh-2a cpu description example of other cpu cmp/ge r1,r0 bt trget0 bf trget1 t bit is set when r0 r1. the program branches to trget0 when r0 r1 and to trget1 when r0 < r1. cmp.w r1,r0 bge trget0 blt trget1 add # ? 1,r0 cmp/eq #0,r0 bt trget t bit is not changed by add. t bit is set when r0 = 0. the program branches if r0 = 0. sub.w #1,r0 beq trget (10) immediate data byte immediate data is located in an instructi on code. word or longword immediate data is not located in instruction codes but in a memory tabl e. the memory table is accessed by an immediate data transfer instruction (mov) using the pc relative addressing mode with displacement. with the sh-2a, 17- to 28-bit immediate data can be located in an instruction code. however, for 21- to 28-bit immediate data, an or instruction must be executed after the data is transferred to a register. table 2.5 immediat e data accessing classification sh-2a cpu example of other cpu 8-bit immediate mov #h'12,r0 mov.b #h'12,r0 16-bit immediate movi20 #h'1234,r0 mov.w #h'1234,r0 20-bit immediate movi20 #h'12345,r0 mov.l #h'12345,r0 28-bit immediate movi20s #h'12345,r0 or #h'67,r0 mov.l #h'1234567,r0 32-bit immediate mov.l @(disp,pc),r0 ................. .data.l h'12345678 mov.l #h'12345678,r0 note: @(disp, pc) accesses the immediate data.
section 2 cpu rev. 1.00 nov. 14, 2007 page 39 of 1262 rej09b0437-0100 (11) absolute address when data is accessed by an absolute address, the absolute address valu e should be placed in the memory table in advance. that va lue is transferred to the register by loading the immediate data during the execution of the instruction, and the data is accessed in regist er indirect addressing mode. with the sh-2a, when data is refe renced using an absolute address not exceeding 28 bi ts, it is also possible to transfer immedi ate data located in the instruction code to a register and to reference the data in register indirect addressing mode. however, when referencing data using an absolute address of 21 to 28 bits, an or instruction must be used after the data is transferred to a register. table 2.6 absolute address accessing classification sh-2a cpu example of other cpu up to 20 bits movi20 #h'12345,r1 mov.b @r1,r0 mov.b @h'12345,r0 21 to 28 bits movi20s #h'12345,r1 or #h'67,r1 mov.b @r1,r0 mov.b @h'1234567,r0 29 bits or more mov.l @(disp,pc),r1 mov.b @r1,r0 .................. .data.l h'12345678 mov.b @h'12345678,r0 (12) 16-bit/32-bit displacement when data is accessed by 16-bit or 32-bit displacement, the disp lacement value should be placed in the memory table in advance. that value is tr ansferred to the register by loading the immediate data during the execution of the instruction, and the data is accessed in the indexed indirect register addressing mode. table 2.7 displacement accessing classification sh-2a cpu example of other cpu 16-bit displacement mov.w @(disp,pc),r0 mov.w @(r0,r1),r2 .................. .data.w h'1234 mov.w @(h'1234,r1),r2
section 2 cpu rev. 1.00 nov. 14, 2007 page 40 of 1262 rej09b0437-0100 2.3.2 addressing modes addressing modes and effective ad dress calculation are as follows: table 2.8 addressing modes and effective addresses addressing mode instruction format effective address calculation equation register direct rn the effective address is register rn. (the operand is the contents of register rn.) ? register indirect @rn the effective address is t he contents of register rn. rn rn rn register indirect with post- increment @rn+ the effective address is the contents of register rn. a constant is added to t he contents of rn after the instruction is executed. 1 is added for a byte operation, 2 for a word operation, and 4 for a longword operation. rn rn 1/2/4 + rn + 1/2/4 rn (after instruction execution) byte: rn + 1 rn word: rn + 2 rn longword: rn + 4 rn register indirect with pre- decrement @-rn the effective address is the value obtained by subtracting a constant from rn. 1 is subtracted for a byte operation, 2 for a word operation, and 4 for a longword operation. rn 1/2/4 rn ? 1/2/4 ? rn ? 1/2/4 byte: rn ? 1 rn word: rn ? 2 rn longword: rn ? 4 rn (instruction is executed with rn after this calculation)
section 2 cpu rev. 1.00 nov. 14, 2007 page 41 of 1262 rej09b0437-0100 addressing mode instruction format effective address calculation equation register indirect with displacement @(disp:4, rn) the effective address is the sum of rn and a 4-bit displacement (disp). the value of disp is zero- extended, and remains unchanged for a byte operation, is doubled for a word operation, and is quadrupled for a longword operation. rn rn + disp 1/2/4 + 1/2/4 disp (zero-extended) byte: rn + disp word: rn + disp 2 longword: rn + disp 4 register indirect with displacement @(disp:12, rn) the effective address is the sum of rn and a 12- bit displacement (disp). the value of disp is zero- extended. + rn disp (zero-extended) rn + disp byte: rn + disp word: rn + disp longword: rn + disp indexed register indirect @(r0,rn) the effective address is the sum of rn and r0. rn r0 rn + r0 + rn + r0 gbr indirect with displacement @(disp:8, gbr) the effective address is the sum of gbr value and an 8-bit displacement (disp). the value of disp is zero-extended, and remains unchanged for a byte operation, is doubled for a word operation, and is quadrupled for a longword operation. gbr 1/2/4 gbr + disp 1/2/4 + disp (zero-extended) byte: gbr + disp word: gbr + disp 2 longword: gbr + disp 4
section 2 cpu rev. 1.00 nov. 14, 2007 page 42 of 1262 rej09b0437-0100 addressing mode instruction format effective address calculation equation indexed gbr indirect @(r0, gbr) the effective address is the sum of gbr value and r0. gbr r0 gbr + r0 + gbr + r0 tbr duplicate indirect with displacement @@ (disp:8, tbr) the effective address is the sum of tbr value and an 8-bit displacement (disp). the value of disp is zero-extended, and is multiplied by 4. tbr tbr + disp 4 (tbr + disp 4) 4 + disp (zero-extended) contents of address (tbr + disp 4) pc indirect with displacement @(disp:8, pc) the effective address is the sum of pc value and an 8-bit displacement (disp). the value of disp is zero-extended, and is doubled for a word operation, and quadrupled for a longword operation. for a longword operation, the lowest two bits of the pc value are masked. pc h'fffffffc pc + disp 2 or pc & h'fffffffc + disp 4 + 2/4 & (for longword) disp (zero-extended) word: pc + disp 2 longword: pc & h'fffffffc + disp 4
section 2 cpu rev. 1.00 nov. 14, 2007 page 43 of 1262 rej09b0437-0100 addressing mode instruction format effective address calculation equation pc relative disp:8 the effective address is the sum of pc value and the value that is obtained by doubling the sign- extended 8-bit displacement (disp). pc 2 + disp (sign-extended) pc + disp 2 pc + disp 2 disp:12 the effective address is the sum of pc value and the value that is obtained by doubling the sign- extended 12-bit displacement (disp). pc 2 + disp (sign-extended) pc + disp 2 pc + disp 2 rn the effective address is the sum of pc value and rn. pc rn pc + rn + pc + rn
section 2 cpu rev. 1.00 nov. 14, 2007 page 44 of 1262 rej09b0437-0100 addressing mode instruction format effective address calculation equation the 20-bit immediate data (imm) for the movi20 instruction is sign-extended. sign- extended imm (20 bits) 31 19 0 ? immediate #imm:20 the 20-bit immediate data (imm) for the movi20s instruction is shifted by eight bits to the left, the upper bits are sign-extended, and the lower bits are padded with zero. sign-extended imm (20 bits) 00000000 31 27 8 0 ? #imm:8 the 8-bit immediate data (imm) for the tst, and, or, and xor instructions is zero-extended. ? #imm:8 the 8-bit immediate data (imm) for the mov, add, and cmp/eq instructions is sign-extended. ? #imm:8 the 8-bit immediate data (imm) for the trapa instruction is zero-extended and then quadrupled. ? #imm:3 the 3-bit immediate data (imm) for the band, bor, bxor, bst, bld, bset, and bclr instructions indicates the target bit location. ?
section 2 cpu rev. 1.00 nov. 14, 2007 page 45 of 1262 rej09b0437-0100 2.3.3 instruction format the instruction formats and the m eaning of source and destination operands are described below. the meaning of the operand depends on the instru ction code. the symbols used are as follows: ? xxxx: instruction code ? mmmm: source register ? nnnn: destination register ? iiii: immediate data ? dddd: displacement table 2.9 instruction formats instruction formats source operand destination operand example 0 format xxxx xxxx xxxx xxxx 15 0 ? ? nop ? nnnn: register direct movt rn control register or system register nnnn: register direct sts mach,rn r0 (register direct) nnnn: register direct divu r0,rn control register or system register nnnn: register indirect with pre- decrement stc.l sr,@-rn mmmm: register direct r15 (register indirect with pre- decrement) movmu.l rm,@-r15 r15 (register indirect with post- increment) nnnn: register direct movmu.l @r15+,rn n format xxxx xxxx xxxx nnnn 15 0 r0 (register direct) nnnn: (register indirect with post- increment) mov.l r0,@rn+
section 2 cpu rev. 1.00 nov. 14, 2007 page 46 of 1262 rej09b0437-0100 instruction formats source operand destination operand example mmmm: register direct control register or system register ldc rm,sr mmmm: register indirect with post- increment control register or system register ldc.l @rm+,sr mmmm: register indirect ? jmp @rm mmmm: register indirect with pre- decrement r0 (register direct) mov.l @-rm,r0 m format xxxx mmmm xxxx xxxx 15 0 mmmm: pc relative using rm ? braf rm mmmm: register direct nnnn: register direct add rm,rn mmmm: register direct nnnn: register indirect mov.l rm,@rn mmmm: register indirect with post- increment (multiply- and-accumulate) nnnn * : register indirect with post- increment (multiply- and-accumulate) mach, macl mac.w @rm+,@rn+ mmmm: register indirect with post- increment nnnn: register direct mov.l @rm+,rn mmmm: register direct nnnn: register indirect with pre- decrement mov.l rm,@-rn nm format nnnn xxxx xxxx 15 0 mmmm mmmm: register direct nnnn: indexed register indirect mov.l rm,@(r0,rn) md format xxxx dddd 15 0 mmmm xxxx mmmmdddd: register indirect with displacement r0 (register direct) mov.b @(disp,rm),r0
section 2 cpu rev. 1.00 nov. 14, 2007 page 47 of 1262 rej09b0437-0100 instruction formats source operand destination operand example nd4 format xxxx xxxx dddd 15 0 nnnn r0 (register direct) nnnndddd: register indirect with displacement mov.b r0,@(disp,rn) mmmm: register direct nnnndddd: register indirect with displacement mov.l rm,@(disp,rn) nmd format nnnn xxxx dddd 15 0 mmmm mmmmdddd: register indirect with displacement nnnn: register direct mov.l @(disp,rm),rn mmmm: register direct nnnndddd: register indirect with displacement mov.l rm,@(disp12,rn) nmd12 format xxxx dddd dddd dddd 15 0 xxxx mmmm xxxx nnnn 32 16 mmmmdddd: register indirect with displacement nnnn: register direct mov.l @(disp12,rm),rn dddddddd: gbr indirect with displacement r0 (register direct) mov.l @(disp,gbr),r0 r0 (register direct) dddddddd: gbr indirect with displacement mov.l r0,@(disp,gbr) dddddddd: pc relative with displacement r0 (register direct) mova @(disp,pc),r0 dddddddd: tbr duplicate indirect with displacement ? jsr/n @@(disp8,tbr) d format dddd xxxx 15 0 xxxx dddd dddddddd: pc relative ? bf label d12 format dddd xxxx 15 0 dddd dddd dddddddddddd: pc relative ? bra label (label = disp + pc) nd8 format dddd nnnn xxxx 15 0 dddd dddddddd: pc relative with displacement nnnn: register direct mov.l @(disp,pc),rn
section 2 cpu rev. 1.00 nov. 14, 2007 page 48 of 1262 rej09b0437-0100 instruction formats source operand destination operand example iiiiiiii: immediate indexed gbr indirect and.b #imm,@(r0,gbr) iiiiiiii: immediate r0 (register direct) and #imm,r0 i format xxxx xxxx iiii 15 0 iiii iiiiiiii: immediate ? trapa #imm ni format nnnn iiii xxxx 15 0 iiii iiiiiiii: immediate nnnn: register direct add #imm,rn nnnn: register direct iii: immediate ? bld #imm3,rn ni3 format xxxx nnnn xxxx 15 0 iii x ? nnnn: register direct iii: immediate bst #imm3,rn ni20 format iiii iiii iiii iiii 15 0 xxxx iiii xxxx nnnn 32 16 iiiiiiiiiiiiiiiiiiii: immediate nnnn: register direct movi20 #imm20, rn nnnndddddddddddd: register indirect with displacement iii: immediate ? bld.b #imm3,@(disp12,rn ) nid format xxxx dddd dddd dddd 15 0 xxxx xiii xxxx nnnn 32 16 ? nnnndddddddddddd: register indirect with displacement iii: immediate bst.b #imm3,@(disp12,rn ) note: * in multiply-and-accumula te instructions, nnnn is the source register.
section 2 cpu rev. 1.00 nov. 14, 2007 page 49 of 1262 rej09b0437-0100 2.4 instruction set 2.4.1 instruction set by classification table 2.10 lists the instructions according to their classification. table 2.10 classification of instructions classification types operation code function no. of instructions mov data transfer immediate data transfer peripheral module data transfer structure data transfer reverse stack transfer mova effective address transfer movi20 20-bit immediate data transfer movi20s 20-bit immediate data transfer 8-bit left-shit movml r0 ? rn register save/restore movmu rn ? r14 and pr register save/restore movrt t bit inversion and transfer to rn movt t bit transfer movu unsigned data transfer nott t bit inversion pref prefetch to operand cache swap swap of upper and lower bytes data transfer 13 xtrct extraction of the middl e of registers connected 62
section 2 cpu rev. 1.00 nov. 14, 2007 page 50 of 1262 rej09b0437-0100 classification types operation code function no. of instructions 26 add binary addition 40 addc binary addition with carry addv binary addition with overflow check cmp/cond comparison clips signed saturation value comparison clipu unsigned saturation value comparison divs signed division (32 32) divu unsigned division (32 32) div1 one-step division arithmetic operations div0s initialization of signed one-step division div0u initialization of unsigned one-step division dmuls signed double-precision multiplication dmulu unsigned double-precision multiplication dt decrement and test exts sign extension extu zero extension mac multiply-and-accumulate, double-precision multiply-and-accumulate operation mul double-precision multiply operation mulr signed multiplication with result storage in rn muls signed multiplication mulu unsigned multiplication neg negation negc negation with borrow sub binary subtraction subc binary subtraction with borrow subv binary subtraction with underflow
section 2 cpu rev. 1.00 nov. 14, 2007 page 51 of 1262 rej09b0437-0100 classification types operation code function no. of instructions 6 and logical and 14 not bit inversion or logical or tas memory test and bit set tst logical and and t bit set logic operations xor exclusive or shift 12 rotl one-bit left rotation 16 rotr one-bit right rotation rotcl one-bit left rotation with t bit rotcr one-bit right rotation with t bit shad dynamic arithmetic shift shal one-bit arithmetic left shift shar one-bit arithmetic right shift shld dynamic logical shift shll one-bit logical left shift shlln n-bit logical left shift shlr one-bit logical right shift shlrn n-bit logical right shift branch 10 bf conditional branch, conditional delayed branch (branch when t = 0) 15 bt conditional branch, conditional delayed branch (branch when t = 1) bra unconditional delayed branch braf unconditional delayed branch bsr delayed branch to subroutine procedure bsrf delayed branch to subroutine procedure jmp unconditional delayed branch jsr branch to subroutine procedure delayed branch to subroutine procedure rts return from subroutine procedure delayed return from subroutine procedure rtv/n return from subroutine procedure with rm r0 transfer
section 2 cpu rev. 1.00 nov. 14, 2007 page 52 of 1262 rej09b0437-0100 classification types operation code function no. of instructions 14 clrt t bit clear 36 clrmac mac register clear system control ldbank register restoration from specified register bank entry ldc load to control register lds load to system register nop no operation resbank register restoration from register bank rte return from exception handling sett t bit set sleep transition to power-down mode stbank register save to specified register bank entry stc store control register data sts store system register data trapa trap exception handling 19 fabs floating-poin t absolute value 48 floating-point instructions fadd floating-point addition fcmp floating-point comparison fcnvds conversion from double-precision to single- precision fcnvsd conversion from single-precision to double - precision fdiv floating-point division fldi0 floating-point load immediate 0 fldi1 floating-point load immediate 1 flds floating-point load into system register fpul float conversion from integer to floating-point fmac floating-point multiply and accumulate operation fmov floating-point data transfer fmul floating-point multiplication fneg floating-point sign inversion
section 2 cpu rev. 1.00 nov. 14, 2007 page 53 of 1262 rej09b0437-0100 classification types operation code function no. of instructions 19 fschg sz bit inversion 48 floating-point instructions fsqrt floating-point square root fsts floating-point store from system register fpul fsub floating-point subtraction ftrc floating-point conversion with rounding to integer lds load into floating-point system register fpu-related cpu instructions 2 sts store from floating-point system register 8 10 band bit and 14 bit manipulation bclr bit clear bld bit load bor bit or bset bit set bst bit store bxor bit exclusive or bandnot bit not and bornot bit not or bldnot bit not load total: 112 253
section 2 cpu rev. 1.00 nov. 14, 2007 page 54 of 1262 rej09b0437-0100 the table below shows the format of instruction c odes, operation, and execution states. they are described by using this format according to their classification. instruction instruction code operation execution states t bit indicated by mnemonic. [legend] rm: source register rn: destination register imm: immediate data disp: displacement * 2 indicated in msb ? lsb order. [legend] mmmm: source register nnnn: destination register 0000: r0 0001: r1 ......... 1111: r15 iiii: immediate data dddd: displacement indicates summary of operation. [legend] , : transfer direction (xx): memory operand m/q/t: flag bits in sr &: logical and of each bit |: logical or of each bit ^: exclusive logical or of each bit ~: logical not of each bit <>n: n-bit right shift value when no wait states are inserted. * 1 value of t bit after instruction is executed. explanation of symbols ?: no change notes: 1. instruction execution cycles: the execution cycl es shown in the table are minimums. in practice, the number of instruction execut ion states will be increased in cases such as the following: a. when there is a conflict between an instruction fetch and a data access b. when the destination register of a load instruction (memory register) is the same as the register used by the next instruction. 2. depending on the operand size, displacement is scaled by 1, 2, or 4. for details, refer to the sh-2a, sh2a-fpu software manual.
section 2 cpu rev. 1.00 nov. 14, 2007 page 55 of 1262 rej09b0437-0100 2.4.2 data transfer instructions table 2.11 data transfer instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a mov #imm,rn 1110nnnniiiiiiii imm sign extension rn 1 ? yes yes yes mov.w @(disp,pc),rn 1001nnnndddddddd (disp 2 + pc) sign extension rn 1 ? yes yes yes mov.l @(disp,pc),rn 1101nnnndddddddd (disp 4 + pc) rn 1 ? yes yes yes mov rm,rn 0110nnnnmmmm0011 rm rn 1 ? yes yes yes mov.b rm,@rn 0010nnnnmmmm0000 rm (rn) 1 ? yes yes yes mov.w rm,@rn 0010nnnnmmmm0001 rm (rn) 1 ? yes yes yes mov.l rm,@rn 0010nnnnmmmm0010 rm (rn) 1 ? yes yes yes mov.b @rm,rn 0110nnnnmmmm0000 (rm) sign extension rn 1 ? yes yes yes mov.w @rm,rn 0110nnnnmmmm0001 (rm) sign extension rn 1 ? yes yes yes mov.l @rm,rn 0110nnnnmmmm0010 (rm) rn 1 ? yes yes yes mov.b rm,@-rn 0010nnnnmmmm0100 rn-1 rn, rm (rn) 1 ? yes yes yes mov.w rm,@-rn 0010nnnnmmmm0101 rn-2 rn, rm (rn) 1 ? yes yes yes mov.l rm,@-rn 0010nnnnmmmm0110 rn-4 rn, rm (rn) 1 ? yes yes yes mov.b @rm+,rn 0110nnnnmmmm0100 (rm) sign extension rn, rm + 1 rm 1 ? yes yes yes mov.w @rm+,rn 0110nnnnmmmm0101 (rm) sign extension rn, rm + 2 rm 1 ? yes yes yes mov.l @rm+,rn 0110nnnnmmmm0110 (rm) rn, rm + 4 rm 1 ? yes yes yes mov.b r0,@(disp,rn) 10000000nnnndddd r0 (disp + rn) 1 ? yes yes yes mov.w r0,@(disp,rn) 10000001nnnndddd r0 (disp 2 + rn) 1 ? yes yes yes mov.l rm,@(disp,rn) 0001nnnnmmmmdddd rm (disp 4 + rn) 1 ? yes yes yes mov.b @(disp,rm),r0 10000100mmmmdddd (disp + rm) sign extension r0 1 ? yes yes yes mov.w @(disp,rm),r0 10000101mmmmdddd (disp 2 + rm) sign extension r0 1 ? yes yes yes mov.l @(disp,rm),rn 0101nnnnmmmmdddd (disp 4 + rm) rn 1 ? yes yes yes mov.b rm,@(r0,rn) 0000nnnnmmmm0100 rm (r0 + rn) 1 ? yes yes yes mov.w rm,@(r0,rn) 0000nnnnmmmm0101 rm (r0 + rn) 1 ? yes yes yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 56 of 1262 rej09b0437-0100 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a mov.l rm,@(r0,rn) 0000nnnnmmmm0110 rm (r0 + rn) 1 ? yes yes yes mov.b @(r0,rm),rn 0000nnnnmmmm1100 (r0 + rm) sign extension rn 1 ? yes yes yes mov.w @(r0,rm),rn 0000nnnnmmmm1101 (r0 + rm) sign extension rn 1 ? yes yes yes mov.l @(r0,rm),rn 0000nnnnmmmm1110 (r0 + rm) rn 1 ? yes yes yes mov.b r0,@(disp,gbr) 11000000dddddddd r0 (disp + gbr) 1 ? yes yes yes mov.w r0,@(disp,gbr) 11000001dddddddd r0 (disp 2 + gbr) 1 ? yes yes yes mov.l r0,@(disp,gbr) 11000010dddddddd r0 (disp 4 + gbr) 1 ? yes yes yes mov.b @(disp,gbr),r0 11000100dddddddd (disp + gbr) sign extension r0 1 ? yes yes yes mov.w @(disp,gbr),r0 11000101dddddddd (disp 2 + gbr) sign extension r0 1 ? yes yes yes mov.l @(disp,gbr),r0 11000110dddddddd (disp 4 + gbr) r0 1 ? yes yes yes mov.b r0,@rn+ 0100nnnn10001011 r0 (rn), rn + 1 rn 1 ? yes mov.w r0,@rn+ 0100nnnn10011011 r0 (rn), rn + 2 rn 1 ? yes mov.l r0,@rn+ 0100nnnn10101011 r0 rn), rn + 4 rn 1 ? yes mov.b @-rm,r0 0100mmmm11001011 rm-1 rm, (rm) sign extension r0 1 ? yes mov.w @-rm,r0 0100mmmm11011011 rm-2 rm, (rm) sign extension r0 1 ? yes mov.l @-rm,r0 0100mmmm11101011 rm-4 rm, (rm) r0 1 ? yes mov.b rm,@(disp12,rn) 0011nnnnmmmm0001 0000dddddddddddd rm (disp + rn) 1 ? yes mov.w rm,@(disp12,rn) 0011nnnnmmmm0001 0001dddddddddddd rm (disp 2 + rn) 1 ? yes mov.l rm,@(disp12,rn) 0011nnnnmmmm0001 0010dddddddddddd rm (disp 4 + rn) 1 ? yes mov.b @(disp12,rm),rn 0011nnnnmmmm0001 0100dddddddddddd (disp + rm) sign extension rn 1 ? yes mov.w @(disp12,rm),rn 0011nnnnmmmm0001 0101dddddddddddd (disp 2 + rm) sign extension rn 1 ? yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 57 of 1262 rej09b0437-0100 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a mov.l @(disp12,rm),rn 0011nnnnmmmm0001 0110dddddddddddd (disp 4 + rm) rn 1 ? yes mova @(disp,pc),r0 11000111dddddddd disp 4 + pc r0 1 ? yes yes yes movi20 #imm20,rn 0000nnnniiii0000 iiiiiiiiiiiiiiii imm sign extension rn 1 ? yes movi20s #imm20,rn 0000nnnniiii0001 iiiiiiiiiiiiiiii imm << 8 sign extension rn 1 ? yes movml.l rm,@-r15 0100mmmm11110001 r15-4 r15, rm (r15) r15-4 r15, rm-1 (r15) : r15-4 r15, r0 (r15) note: when rm = r15, read rm as pr 1 to 16 ? yes movml.l @r15+,rn 0100nnnn11110101 (r15) r0, r15 + 4 r15 (r15) r1, r15 + 4 r15 : (r15) rn note: when rn = r15, read rn as pr 1 to 16 ? yes movmu.l rm,@-r15 0100mmmm11110000 r15-4 r15, pr (r15) r15-4 r15, r14 (r15) : r15-4 r15, rm (r15) note: when rm = r15, read rm as pr 1 to 16 ? yes movmu.l @r15+,rn 0100nnnn11110100 (r15) rn, r15 + 4 r15 (r15) rn + 1, r15 + 4 r15 : (r15) r14, r15 + 4 r15 (r15) pr note: when rn = r15, read rn as pr 1 to 16 ? yes movrt rn 0000nnnn00111001 ~t rn 1 ? yes movt rn 0000nnnn00101001 t rn 1 ? yes yes yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 58 of 1262 rej09b0437-0100 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a movu.b @(disp12,rm),rn 0011nnnnmmmm0001 1000dddddddddddd (disp + rm) zero extension rn 1 ? yes movu.w @(disp12,rm),rn 0011nnnnmmmm0001 1001dddddddddddd (disp 2 + rm) zero extension rn 1 ? yes nott 0000000001101000 ~t t 1 ope- ration result yes pref @rn 0000nnnn10000011 (rn) operand cache 1 ? yes yes swap.b rm,rn 0110nnnnmmmm1000 rm swap lower 2 bytes rn 1 ? yes yes yes swap.w rm,rn 0110nnnnmmmm1001 rm swap upper and lower words rn 1 ? yes yes yes xtrct rm,rn 0010nnnnmmmm1101 middle 32 bits of rm:rn rn 1 ? yes yes yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 59 of 1262 rej09b0437-0100 2.4.3 arithmetic operation instructions table 2.12 arithmetic operation instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a add rm,rn 0011nnnnmmmm1100 rn + rm rn 1 ? yes yes yes add #imm,rn 0111nnnniiiiiiii rn + imm rn 1 ? yes yes yes addc rm,rn 0011nnnnmmmm1110 rn + rm + t rn, carry t 1 carry yes yes yes addv rm,rn 0011nnnnmmmm1111 rn + rm rn, overflow t 1 over- flow yes yes yes cmp/eq #imm,r0 10001000iiiiiiii when r0 = imm, 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/eq rm,rn 0011nnnnmmmm0000 when rn = rm, 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/hs rm,rn 0011nnnnmmmm0010 when rn rm (unsigned), 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/ge rm,rn 0011nnnnmmmm0011 when rn rm (signed), 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/hi rm,rn 0011nnnnmmmm0110 when rn > rm (unsigned), 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/gt rm,rn 0011nnnnmmmm0111 when rn > rm (signed), 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/pl rn 0100nnnn00010101 when rn > 0, 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/pz rn 0100nnnn00010001 when rn 0, 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/str rm,rn 0010nnnnmmmm1100 when any bytes are equal, 1 t otherwise, 0 t 1 com- parison result yes yes yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 60 of 1262 rej09b0437-0100 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a clips.b rn 0100nnnn10010001 when rn > (h'0000007f), (h'0000007f) rn, 1 cs when rn < (h'ffffff80), (h'ffffff80) rn, 1 cs 1 ? yes clips.w rn 0100nnnn10010101 when rn > (h'00007fff), (h'00007fff) rn, 1 cs when rn < (h'ffff8000), (h'ffff8000) rn, 1 cs 1 ? yes clipu.b rn 0100nnnn10000001 when rn > (h'000000ff), (h'000000ff) rn, 1 cs 1 ? yes clipu.w rn 0100nnnn10000101 when rn > (h'0000ffff), (h'0000ffff) rn, 1 cs 1 ? yes div1 rm,rn 0011nnnnmmmm0100 1-step division (rn rm) 1 calcu- lation result yes yes yes div0s rm,rn 0010nnnnmmmm0111 msb of rn q, msb of rm m, m ^ q t 1 calcu- lation result yes yes yes div0u 0000000000011001 0 m/q/t 1 0 yes yes yes divs r0,rn 0100nnnn10010100 signed operation of rn r0 rn 32 32 32 bits 36 ? yes divu r0,rn 0100nnnn10000100 unsigned operation of rn r0 rn 32 32 32 bits 34 ? yes dmuls.l rm,rn 0011nnnnmmmm1101 signed operation of rn rm mach, macl 32 32 64 bits 2 ? yes yes yes dmulu.l rm,rn 0011nnnnmmmm0101 unsigned operation of rn rm mach, macl 32 32 64 bits 2 ? yes yes yes dt rn 0100nnnn00010000 rn ? 1 rn when rn is 0, 1 t when rn is not 0, 0 t 1 compa- rison result yes yes yes exts.b rm,rn 0110nnnnmmmm1110 byte in rm is sign-extended rn 1 ? yes yes yes exts.w rm,rn 0110nnnnmmmm1111 word in rm is sign-extended rn 1 ? yes yes yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 61 of 1262 rej09b0437-0100 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a extu.b rm,rn 0110nnnnmmmm1100 byte in rm is zero-extended rn 1 ? yes yes yes extu.w rm,rn 0110nnnnmmmm1101 word in rm is zero-extended rn 1 ? yes yes yes mac.l @rm+,@rn+ 0000nnnnmmmm1111 signed operation of (rn) (rm) + mac mac 32 32 + 64 64 bits 4 ? yes yes yes mac.w @rm+,@rn+ 0100nnnnmmmm1111 signed operation of (rn) (rm) + mac mac 16 16 + 64 64 bits 3 ? yes yes yes mul.l rm,rn 0000nnnnmmmm0111 rn rm macl 32 32 32 bits 2 ? yes yes yes mulr r0,rn 0100nnnn10000000 r0 rn rn 32 32 32 bits 2 yes muls.w rm,rn 0010nnnnmmmm1111 signed operation of rn rm macl 16 16 32 bits 1 ? yes yes yes mulu.w rm,rn 0010nnnnmmmm1110 unsigned operation of rn rm macl 16 16 32 bits 1 ? yes yes yes neg rm,rn 0110nnnnmmmm1011 0-rm rn 1 ? yes yes yes negc rm,rn 0110nnnnmmmm1010 0-rm-t rn, borrow t 1 borrow yes yes yes sub rm,rn 0011nnnnmmmm1000 rn-rm rn 1 ? yes yes yes subc rm,rn 0011nnnnmmmm1010 rn-rm-t rn, borrow t 1 borrow yes yes yes subv rm,rn 0011nnnnmmmm1011 rn-rm rn, underflow t 1 over- flow yes yes yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 62 of 1262 rej09b0437-0100 2.4.4 logic operation instructions table 2.13 logic operation instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a and rm,rn 0010nnnnmmmm1001 rn & rm rn 1 ? yes yes yes and #imm,r0 11001001iiiiiiii r0 & imm r0 1 ? yes yes yes and.b #imm,@(r0,gbr) 11001101iiiiiiii (r0 + gbr) & imm (r0 + gbr) 3 ? yes yes yes not rm,rn 0110nnnnmmmm0111 ~rm rn 1 ? yes yes yes or rm,rn 0010nnnnmmmm1011 rn | rm rn 1 ? yes yes yes or #imm,r0 11001011iiiiiiii r0 | imm r0 1 ? yes yes yes or.b #imm,@(r0,gbr) 11001111iiiiiiii (r0 + gbr) | imm (r0 + gbr) 3 ? yes yes yes tas.b @rn 0100nnnn00011011 when (rn) is 0, 1 t otherwise, 0 t, 1 msb of(rn) 3 test result yes yes yes tst rm,rn 0010nnnnmmmm1000 rn & rm when the result is 0, 1 t otherwise, 0 t 1 test result yes yes yes tst #imm,r0 11001000iiiiiiii r0 & imm when the result is 0, 1 t otherwise, 0 t 1 test result yes yes yes tst.b #imm,@(r0,gbr) 11001100iiiiiiii (r0 + gbr) & imm when the result is 0, 1 t otherwise, 0 t 3 test result yes yes yes xor rm,rn 0010nnnnmmmm1010 rn ^ rm rn 1 ? yes yes yes xor #imm,r0 11001010iiiiiiii r0 ^ imm r0 1 ? yes yes yes xor.b #imm,@(r0,gbr) 11001110iiiiiiii (r0 + gbr) ^ imm (r0 + gbr) 3 ? yes yes yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 63 of 1262 rej09b0437-0100 2.4.5 shift instructions table 2.14 shift instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a rotl rn 0100nnnn00000100 t rn msb 1 msb yes yes yes rotr rn 0100nnnn00000101 lsb rn t 1 lsb yes yes yes rotcl rn 0100nnnn00100100 t rn t 1 msb yes yes yes rotcr rn 0100nnnn00100101 t rn t 1 lsb yes yes yes shad rm,rn 0100nnnnmmmm1100 when rm 0, rn << rm rn when rm < 0, rn >> |rm| [msb rn] 1 ? yes yes shal rn 0100nnnn00100000 t rn 0 1 msb yes yes yes shar rn 0100nnnn00100001 msb rn t 1 lsb yes yes yes shld rm,rn 0100nnnnmmmm1101 when rm 0, rn << rm rn when rm < 0, rn >> |rm| [0 rn] 1 ? yes yes shll rn 0100nnnn00000000 t rn 0 1 msb yes yes yes shlr rn 0100nnnn00000001 0 rn t 1 lsb yes yes yes shll2 rn 0100nnnn00001000 rn << 2 rn 1 ? yes yes yes shlr2 rn 0100nnnn00001001 rn >> 2 rn 1 ? yes yes yes shll8 rn 0100nnnn00011000 rn << 8 rn 1 ? yes yes yes shlr8 rn 0100nnnn00011001 rn >> 8 rn 1 ? yes yes yes shll16 rn 0100nnnn00101000 rn << 16 rn 1 ? yes yes yes shlr16 rn 0100nnnn00101001 rn >> 16 rn 1 ? yes yes yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 64 of 1262 rej09b0437-0100 2.4.6 branch instructions table 2.15 branch instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a bf label 10001011dddddddd when t = 0, disp 2 + pc pc, when t = 1, nop 3/1 * ? yes yes yes bf/s label 10001111dddddddd delayed branch when t = 0, disp 2 + pc pc, when t = 1, nop 2/1 * ? yes yes yes bt label 10001001dddddddd when t = 1, disp 2 + pc pc, when t = 0, nop 3/1 * ? yes yes yes bt/s label 10001101dddddddd delayed branch when t = 1, disp 2 + pc pc, when t = 0, nop 2/1 * ? yes yes yes bra label 1010dddddddddddd delayed branch, disp 2 + pc pc 2 ? yes yes yes braf rm 0000mmmm00100011 delayed branch, rm + pc pc 2 ? yes yes yes bsr label 1011dddddddddddd delayed branch, pc pr, disp 2 + pc pc 2 ? yes yes yes bsrf rm 0000mmmm00000011 delayed branch, pc pr, rm + pc pc 2 ? yes yes yes jmp @rm 0100mmmm00101011 delayed branch, rm pc 2 ? yes yes yes jsr @rm 0100mmmm00001011 delayed branch, pc pr, rm pc 2 ? yes yes yes jsr/n @rm 0100mmmm01001011 pc-2 pr, rm pc 3 ? yes jsr/n @@(disp8,tbr) 10000011dddddddd pc-2 pr, (disp 4 + tbr) pc 5 ? yes rts 0000000000001011 delayed branch, pr pc 2 ? yes yes yes rts/n 0000000001101011 pr pc 3 ? yes rtv/n rm 0000mmmm01111011 rm r0, pr pc 3 ? yes note: * one cycle when the program does not branch.
section 2 cpu rev. 1.00 nov. 14, 2007 page 65 of 1262 rej09b0437-0100 2.4.7 system control instructions table 2.16 system control instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a clrt 0000000000001000 0 t 1 0 yes yes yes clrmac 0000000000101000 0 mach,macl 1 ? yes yes yes ldbank @rm,r0 0100mmmm11100101 (specified register bank entry) r0 6 ? yes ldc rm,sr 0100mmmm00001110 rm sr 3 lsb yes yes yes ldc rm,tbr 0100mmmm01001010 rm tbr 1 ? yes ldc rm,gbr 0100mmmm00011110 rm gbr 1 ? yes yes yes ldc rm,vbr 0100mmmm00101110 rm vbr 1 ? yes yes yes ldc.l @rm+,sr 0100mmmm00000111 (rm) sr, rm + 4 rm 5 lsb yes yes yes ldc.l @rm+,gbr 0100mmmm00010111 (rm) gbr, rm + 4 rm 1 ? yes yes yes ldc.l @rm+,vbr 0100mmmm00100111 (rm) vbr, rm + 4 rm 1 ? yes yes yes lds rm,mach 0100mmmm00001010 rm mach 1 ? yes yes yes lds rm,macl 0100mmmm00011010 rm macl 1 ? yes yes yes lds rm,pr 0100mmmm00101010 rm pr 1 ? yes yes yes lds.l @rm+,mach 0100mmmm00000110 (rm) mach, rm + 4 rm 1 ? yes yes yes lds.l @rm+,macl 0100mmmm00010110 (rm) macl, rm + 4 rm 1 ? yes yes yes lds.l @rm+,pr 0100mmmm00100110 (rm) pr, rm + 4 rm 1 ? yes yes yes nop 0000000000001001 no operation 1 ? yes yes yes resbank 0000000001011011 bank r0 to r14, gbr, mach, macl, pr 9 * ? yes rte 0000000000101011 delayed branch, stack area pc/sr 6 ? yes yes yes sett 0000000000011000 1 t 1 1 yes yes yes sleep 0000000000011011 sleep 5 ? yes yes yes stbank r0,@rn 0100nnnn11100001 r0 (specified register bank entry) 7 ? yes stc sr,rn 0000nnnn00000010 sr rn 2 ? yes yes yes stc tbr,rn 0000nnnn01001010 tbr rn 1 ? yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 66 of 1262 rej09b0437-0100 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a stc gbr,rn 0000nnnn00010010 gbr rn 1 ? yes yes yes stc vbr,rn 0000nnnn00100010 vbr rn 1 ? yes yes yes stc.l sr,@-rn 0100nnnn00000011 rn-4 rn, sr (rn) 2 ? yes yes yes stc.l gbr,@-rn 0100nnnn00010011 rn-4 rn, gbr (rn) 1 ? yes yes yes stc.l vbr,@-rn 0100nnnn00100011 rn-4 rn, vbr (rn) 1 ? yes yes yes sts mach,rn 0000nnnn00001010 mach rn 1 ? yes yes yes sts macl,rn 0000nnnn00011010 macl rn 1 ? yes yes yes sts pr,rn 0000nnnn00101010 pr rn 1 ? yes yes yes sts.l mach,@-rn 0100nnnn00000010 rn-4 rn, mach (rn) 1 ? yes yes yes sts.l macl,@-rn 0100nnnn00010010 rn-4 rn, macl (rn) 1 ? yes yes yes sts.l pr,@-rn 0100nnnn00100010 rn-4 rn, pr (rn) 1 ? yes yes yes trapa #imm 11000011iiiiiiii pc/sr stack area, (imm 4 + vbr) pc 5 ? yes yes yes notes: 1. instruction execution cycles: the execution cycl es shown in the table are minimums. in practice, the number of instruction executio n states in cases su ch as the following: a. when there is a conflict between an instruction fetch and a data access b. when the destination register of a load instruction (memory register) is the same as the register used by the next instruction. * in the event of bank overflow , the number of cycles is 19.
section 2 cpu rev. 1.00 nov. 14, 2007 page 67 of 1262 rej09b0437-0100 2.4.8 floating-point operation instructions table 2.17 floating-point operation instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2e sh4 sh-2a/ sh2a- fpu fabs frn 1111nnnn01011101 |frn| frn 1 ? yes yes yes fabs drn 1111nnn001011101 |drn| drn 1 ? yes yes fadd frm, frn 1111nnnnmmmm0000 frn + frm frn 1 ? yes yes yes fadd drm, drn 1111nnn0mmm00000 drn + drm drn 6 ? yes yes fcmp/eq frm, frn 1111nnnnmmmm0100 (frn = frm)? 1:0 t 1 compa- rison result yes yes yes fcmp/eq drm, drn 1111nnn0mmm00100 (drn = drm)? 1:0 t 2 compa- rison result yes yes fcmp/gt frm, frn 1111nnnnmmmm0101 (frn > frm)? 1:0 t 1 compa -rison result yes yes yes fcmp/gt drm, drn 1111nnn0mmm00101 (drn > drm)? 1:0 t 2 compa- rison result yes yes fcnvds drm, fpul 1111mmm010111101 (float) drm fpul 2 ? yes yes fcnvsd fpul, drn 1111nnn010101101 (double) fpul drn 2 ? yes yes fdiv frm, frn 1111nnnnmmmm0011 frn/frm frn 10 ? yes yes yes fdiv drm, drn 1111nnn0mmm00011 drn/drm drn 23 ? yes yes fldi0 frn 1111nnnn10001101 0 00000000 frn 1 ? yes yes yes fldi1 frn 1111nnnn10011101 0 3f800000 frn 1 ? yes yes yes flds frm, fpul 1111mmmm00011101 frm fpul 1 ? yes yes yes float fpul,frn 1111nnnn00101101 (float)fpul frn 1 ? yes yes yes float fpul,drn 1111nnn000101101 (double)fpul drn 2 ? yes yes fmac fr0,frm,frn 1111nnnnmmmm1110 fr0 frm+frn frn 1 ? yes yes yes fmov frm, frn 1111nnnnmmmm1100 frm frn 1 ? yes yes yes fmov drm, drn 1111nnn0mmm01100 drm drn 2 ? yes yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 68 of 1262 rej09b0437-0100 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2e sh4 sh-2a/ sh2a- fpu fmov.s @(r0, rm), frn 1111nnnnmmmm0110 (r0 + rm) frn 1 ? yes yes yes fmov.d @(r0, rm), drn 1111nnn0mmmm0110 (r0 + rm) drn 2 ? yes yes fmov.s @rm+, frn 1111nnnnmmmm1001 (rm) frn, rm+=4 1 ? yes yes yes fmov.d @rm+, drn 1111nnn0mmmm1001 (rm) drn, rm += 8 2 ? yes yes fmov.s @rm, frn 1111nnnnmmmm1000 (rm) frn 1 ? yes yes yes fmov.d @rm, drn 1111nnn0mmmm1000 (rm) drn 2 ? yes yes fmov.s @(disp12,rm),frn 0011nnnnmmmm0001 0111dddddddddddd (disp 4 + rm) frn 1 ? yes fmov.d @(disp12,rm),drn 0011nnn0mmmm0001 0111dddddddddddd (disp 8 + rm) drn 2 ? yes fmov.s frm, @(r0,rn) 1111nnnnmmmm0111 frm (r0 + rn) 1 ? yes yes yes fmov.d drm, @(r0,rn) 1111nnnnmmm00111 drm (r0 + rn) 2 ? yes yes fmov.s frm, @-rn 1111nnnnmmmm1011 rn-=4, frm (rn) 1 ? yes yes yes fmov.d drm, @-rn 1111nnnnmmm01011 rn-=8, drm (rn) 2 ? yes yes fmov.s frm, @rn 1111nnnnmmmm1010 frm (rn) 1 ? yes yes yes fmov.d drm, @rn 1111nnnnmmm01010 drm (rn) 2 ? yes yes fmov.s frm, @(disp12,rn) 0011nnnnmmmm0001 0011dddddddddddd frm (disp 4 + rn) 1 ? yes fmov.d drm, @(disp12,rn) 0011nnnnmmm00001 0011dddddddddddd drm (disp 8 + rn) 2 ? yes fmul frm, frn 1111nnnnmmmm0010 frn frm frn 1 ? yes yes yes fmul drm, drn 1111nnn0mmm00010 drn drm drn 6 ? yes yes fneg frn 1111nnnn01001101 -frn frn 1 ? yes yes yes fneg drn 1111nnn001001101 -drn drn 1 ? yes yes fschg 1111001111111101 fpscr.sz=~fpscr.s z 1 ? yes yes fsqrt frn 1111nnnn01101101 frn frn 9 ? yes yes fsqrt drn 1111nnn001101101 drn drn 22 ? yes yes fsts fpul,frn 1111nnnn00001101 fpul frn 1 ? yes yes yes fsub frm, frn 1111nnnnmmmm0001 frn-frm frn 1 ? yes yes yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 69 of 1262 rej09b0437-0100 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2e sh4 sh-2a/ sh2a- fpu fsub drm, drn 1111nnn0mmm00001 drn-drm drn 6 ? yes yes ftrc frm, fpul 1111mmmm00111101 (long)frm fpul 1 ? yes yes yes ftrc drm, fpul 1111mmm000111101 (long)drm fpul 2 ? yes yes 2.4.9 fpu-related cpu instructions table 2.18 fpu-related cpu instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2e sh4 sh-2a/ sh2a- fpu lds rm,fpscr 0100mmmm01101010 rm fpscr 1 ? yes yes yes lds rm,fpul 0100mmmm01011010 rm fpul 1 ? yes yes yes lds.l @rm+, fpscr 0100mmmm01100110 (rm) fpscr, rm+=4 1 ? yes yes yes lds.l @rm+, fpul 0100mmmm01010110 (rm) fpul, rm+=4 1 ? yes yes yes sts fpscr, rn 0000nnnn01101010 fpscr rn 1 ? yes yes yes sts fpul,rn 0000nnnn01011010 fpul rn 1 ? yes yes yes sts.l fpscr,@-rn 0100nnnn01100010 rn-=4, fpcsr (rn) 1 ? yes yes yes sts.l fpul,@-rn 0100nnnn01010010 rn-=4, fpul (rn) 1 ? yes yes yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 70 of 1262 rej09b0437-0100 2.4.10 bit manipulation instructions table 2.19 bit manipulation instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a band.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0100dddddddddddd (imm of (disp + rn)) & t 3 ope- ration result yes bandnot.b #imm3,@(disp12,rn) 0011nnnn0iii1001 1100dddddddddddd ~(imm of (disp + rn)) & t t 3 ope- ration result yes bclr.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0000dddddddddddd 0 (imm of (disp + rn)) 3 ? yes bclr #imm3,rn 10000110nnnn0iii 0 imm of rn 1 ? yes bld.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0011dddddddddddd (imm of (disp + rn)) 3 ope- ration result yes bld #imm3,rn 10000111nnnn1iii imm of rn t 1 ope- ration result yes bldnot.b #imm3,@(disp12,rn) 0011nnnn0iii1001 1011dddddddddddd ~(imm of (disp + rn)) t 3 ope- ration result yes bor.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0101dddddddddddd ( imm of (disp + rn)) | t t 3 ope- ration result yes bornot.b #imm3,@(disp12,rn) 0011nnnn0iii1001 1101dddddddddddd ~( imm of (disp + rn)) | t t 3 ope- ration result yes bset.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0001dddddddddddd 1 ( imm of (disp + rn)) 3 ? yes bset #imm3,rn 10000110nnnn1iii 1 imm of rn 1 ? yes bst.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0010dddddddddddd t (imm of (disp + rn)) 3 ? yes bst #imm3,rn 10000111nnnn0iii t imm of rn 1 ? yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 71 of 1262 rej09b0437-0100 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a bxor.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0110dddddddddddd (imm of (disp + rn)) ^ t t 3 ope- ration result yes
section 2 cpu rev. 1.00 nov. 14, 2007 page 72 of 1262 rej09b0437-0100 2.5 processing states the cpu has five processing states: reset, excep tion handling, bus-released, program execution, and power-down. figure 2.6 shows the transitions between the states. power-on reset from any state manual reset from any state power-on reset state manual reset state program execution state sleep mode software standby mode exception handling state exception handling source occurs exception handling ends nmi interrupt or irq interrupt occurs power-down state reset canceled stby bit cleared for sleep instruction reset state interrupt source or dma address error occurs stby and deep bits set for sleep instruction bus-released state bus request generated bus request cleared bus request generated bus request cleared bus request cleared bus request generated figure 2.6 transitions between processing states
section 2 cpu rev. 1.00 nov. 14, 2007 page 73 of 1262 rej09b0437-0100 (1) reset state in the reset state, the cpu is reset. there are tw o kinds of reset, power-on reset and manual reset. (2) exception handling state the exception handling state is a transient state that occurs when exception handling sources such as resets or interrupts alter the cpu?s processing state flow. for a reset, the initial values of the program counter (pc) (execu tion start address) and stack pointer (sp) are fetched from the exception handling vector table and stored; the cpu then branches to the execution start addres s and execution of the program begins. for an interrupt, the stack pointer (sp) is acc essed and the program counter (pc) and status register (sr) are saved to the stack area. the ex ception service routine st art address is fetched from the exception handling vector table; the cpu then branches to that address and the program starts executing, thereby enteri ng the program execution state. (3) program execution state in the program execution state, the cpu sequentially executes the program. (4) power-down state in the power-down state, the cpu stops opera ting to reduce power consumption. the sleep instruction places the cpu in sleep mode or software standby mode. (5) bus-released state in the bus-released state, the cpu releas es bus to a device that has requested it.
section 2 cpu rev. 1.00 nov. 14, 2007 page 74 of 1262 rej09b0437-0100
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 75 of 1262 rej09b0437-0100 section 3 floating-point unit (fpu) 3.1 features the fpu has the following features. ? conforms to ieee754 standard ? 16 single-precision floating-point registers (can also be referenced as eight double-precision registers) ? two rounding modes: round to nearest and round to zero ? denormalization modes: flush to zero ? five exception sources: invalid operation, divide by zero, overflow, underflow, and inexact ? comprehensive instructions: single-precision, double-precision, and system control
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 76 of 1262 rej09b0437-0100 3.2 data formats 3.2.1 floating-point format a floating-point number consists of the following three fields: ? sign (s) ? exponent (e) ? fraction (f) this lsi can handle single-precision and double-precision floating-point numbers, using the formats shown in figures 3.1 and 3.2. 31 30 23 22 0 s e f figure 3.1 format of single -precision floating-point number 63 62 52 51 0 s e f figure 3.2 format of double- precision floating-point number the exponent is expressed in biased form, as follows: e = e + bias the range of unbiased exponent e is e min ? 1 to e max + 1. the two values e min ? 1 and e max + 1 are distinguished as follows. e min ? 1 indicates zero (both positive and negative sign) and a denormalized number, and e max + 1 indicates positive or negative infinity or a non-number (nan). table 3.1 shows e min and e max values.
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 77 of 1262 rej09b0437-0100 table 3.1 floating-point number formats and parameters parameter single-preci sion double-precision total bit width 32 bits 64 bits sign bit 1 bit 1 bit exponent field 8 bits 11 bits fraction field 23 bits 52 bits precision 24 bits 53 bits bias +127 +1023 e max +127 +1023 e min ?126 ?1022 floating-point number value v is determined as follows: if e = e max + 1 and f 0, v is a non-number (nan) irrespective of sign s if e = e max + 1 and f = 0, v = (?1) s (infinity) [positive or negative infinity] if e min e e max , v = (?1) s 2 e (1.f) [normalized number] if e = e min ? 1 and f 0, v = (?1) s 2 emin (0.f) [denormalized number] if e = e min ? 1 and f = 0, v = (?1) s 0 [positive or negative zero]
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 78 of 1262 rej09b0437-0100 table 3.2 shows the ranges of the various numbers in hexadecimal notation. table 3.2 floating-point ranges type single-precision double-precision signaling non- number h'7fff ffff to h'7fc0 0000 h'7fff ffff ffff ffff to h'7ff8 0000 0000 0000 quiet non-number h'7fbf ffff to h'7f80 0001 h'7ff7 ffff ffff ffff to h'7ff0 0000 0000 0001 positive infinity h'7f80 0000 h'7ff0 0000 0000 0000 positive normalized number h'7f7f ffff to h'0080 0000 h'7fef ffff ffff ffff to h'0010 0000 0000 0000 positive denormalized number h'007f ffff to h'0000 0001 h'000f ffff ffff ffff to h'0000 0000 0000 0001 positive zero h'0000 0000 h'0000 0000 0000 0000 negative zero h'8000 0000 h'8000 0000 0000 0000 negative denormalized number h'8000 0001 to h'807f ffff h' 8000 0000 000 0 0001 to h'800f ffff ffff ffff negative normalized number h'8080 0000 to h'ff7f ffff h' 8010 0000 000 0 0000 to h'ffef ffff ffff ffff negative infinity h'ff80 0000 h'fff0 0000 0000 0000 quiet non-number h'ff80 0001 to h'ffbf ffff h'fff0 0000 0000 0001 to h'fff7 ffff ffff ffff signaling non-number h'ffc0 0000 to h 'ffff ffff h'fff8 0000 0000 0000 to h'ffff ffff ffff ffff
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 79 of 1262 rej09b0437-0100 3.2.2 non-numbers (nan) figure 3.3 shows the bit pattern of a non-number (nan). a value is nan in the following case: ? sign bit: don't care ? exponent field: all bits are 1 ? fraction field: at least one bit is 1 the nan is a signaling nan (snan) if the msb of the fraction field is 1, and a quiet nan (qnan) if the msb is 0. 31 30 23 22 0 x n = 1: snan n = 0: qnan 11111111 nxxxxxxxxxxxxxxxxxxxxxx figure 3.3 single-precision nan bit pattern an snan is input in an operation, except copy, fabs, and fneg, that generates a floating-point value. ? when the en.v bit in fpscr is 0, the operation result (output) is a qnan. ? when the en.v bit in fpscr is 1, an invalid operation exception will be generated. in this case, the contents of the operation de stination register are unchanged. if a qnan is input in an operation that generates a floating-point value, and an snan has not been input in that operation, the output will always be a qnan irrespective of the setting of the en.v bit in fpscr. an exception will not be generated in this case. the qnan values as opera tion results are as follows: ? single-precision qnan: h'7fbf ffff ? double-precision qnan: h'7ff7 ffff ffff ffff see the individual instruction descriptions for details of floating-point operations when a non- number (nan) is input.
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 80 of 1262 rej09b0437-0100 3.2.3 denormalized numbers for a denormalized number floating-point value, the exponent field is expressed as 0, and the fraction field as a non-zero value. in the sh2a-fpu, the dn bit in the status regi ster fpscr is always set to 1, therefore a denormalized number (source operand or operation result) is always flushed to 0 in a floating- point operation that generates a value (an operation other than copy, fneg, or fabs). when the dn bit in fpscr is 0, a denormalized number (source operand or operation result) is processed as it is. see the individual instruction descriptions for details of floating-point operations when a denormalized number is input.
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 81 of 1262 rej09b0437-0100 3.3 register descriptions 3.3.1 floating-point registers figure 3.4 shows the floating-point register configuration. there are sixteen 32-bit floating-point registers fpr0 to fpr15, referenced by specifying fr0 to fr15, dr0/2/4/6/8/10/12/14. the correspondence between fr pn and the reference name is determined by the pr and sz bits in fpscr. refer figure 3.4. 1. floating-point registers, fpri (16 registers) fpr0 to fpr15 2. single-precision floating-point registers, fri (16 registers) fr0 to fr15 indicate fpr0 to fpr15 3. double-precision floating-point registers or single-precision floating-point vector registers in pairs, dri (8 registers) a dr register comprise s two fr registers. dr0 = {fr0, fr1}, dr2 = {fr2, fr3}, dr4 = {fr4, fr5}, dr6 = {fr6, fr7}, dr8 = {fr8, fr9}, dr10 = {fr10, fr11}, dr12 = {fr12, fr13}, dr14 = {fr14, fr15} fpr0 fpr1 fpr2 fpr3 fpr4 fpr5 fpr6 fpr7 fpr8 fpr9 fpr10 fpr11 fpr12 fpr13 fpr14 fpr15 fr0 fr1 fr2 fr3 fr4 fr5 fr6 fr7 fr8 fr9 fr10 fr11 fr12 fr13 fr14 fr15 dr0 dr2 dr4 dr6 dr8 dr10 dr12 dr14 transfer instruction case: fpscr.sz = 0 fpscr.sz = 1 operation instruction case: fpscr.pr = 0 fpscr.pr = 1 register name reference name figure 3.4 floating-point registers
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 82 of 1262 rej09b0437-0100 3.3.2 floating-point status/control register (fpscr) fpscr is a 32-bit register that controls floating-point instructions, sets fpu exceptions, and selects the rounding mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000100 r r r r r r r r r r/w r r/w r/w r r/w r/w 0000000000000001 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: - - - - - - - - - qis - sz pr dn cause cause enable flag rm1 rm0 bit bit name initial value r/w description 31 to 23 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 22 qis 0 r/w nonnunerical processing mode 0: processes qnan or as such 1: treats qnan or as the same as snan (valid only when fpscr.enable.v = 1) 21 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 20 sz 0 r/w transfer size mode 0: data size of fmov instruction is 32-bits 1: data size of fmov instruction is a 32-bit register pair (64 bits) 19 pr 0 r/w precision mode 0: floating-point instructi ons are executed as single- precision operations 1: floating-point instructi ons are executed as double- precision operations (graphics support instructions are undefined) 18 dn 1 r denormalization mode (always fixed to 1 in sh2a- fpu) 1: denormalized number is treated as zero
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 83 of 1262 rej09b0437-0100 bit bit name initial value r/w description 17 to 12 cause all 0 r/w 11 to 7 enable all 0 r/w 6 to 2 flag all 0 r/w fpu exception cause field fpu exception enable field fpu exception flag field when an fpu exception occurs, the bits corresponding to the fpu exception cause field and fpu exception flag field are set to 1. each time an fpu operation instruction is executed, t he fpu exception cause field is cleared to 0. the fpu exception flag field remains set to 1 until it is cleared to 0 by software. for bit allocations of each field, see table 3.3. 1 0 rm1 rm0 0 1 r/w r/w rounding mode these bits select the rounding mode. 00: round to nearest 01: round to zero 10: reserved 11: reserved table 3.3 bit allocation for fpu exception handling field name fpu error (e) invalid operation (v) division by zero (z) overflow (o) underflow (u) inexact (i) cause fpu exception cause field bit 17 bit 16 bit 15 bit 14 bit 13 bit 12 enable fpu exception enable field none bit 11 bit 10 bit 9 bit 8 bit 7 flag fpu exception flag field none bit 6 bit 5 bit 4 bit 3 bit 2 note: no fpu error occurs in the sh2a-fpu. 3.3.3 floating-point communication register (fpul) information is transferred between the fpu and cp u via fpul. fpul is a 32 -bit system register that is accessed from the cpu side by means of lds and sts instructions. for example, to convert the integer stored in general register r1 to a single-precision floating-point number, the processing flow is as follows: r1 (lds instruction) fpul (single-precision float instruction) fr1
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 84 of 1262 rej09b0437-0100 3.4 rounding in a floating-point instruction, rounding is performed when generating the final operation result from the intermediate result. therefore, the result of combination instructions such as fmac will differ from the result when using a basic instruct ion such as fadd, fsub, or fmul. rounding is performed once in fmac, but twice in fadd, fsub, and fmul. which of the two rounding methods is to be used is determined by the rm bits in fpscr. fpscr.rm[1:0] = 00: round to nearest fpscr.rm[1:0] = 01: round to zero (1) round to nearest the operation result is rounded to the nearest expressible value. if there are two nearest expressible values, the one with an lsb of 0 is selected. if the unrounded value is 2 emax (2 ? 2 ?p ) or more, the result will be infinity with the same sign as the unrounded value. the values of emax and p, respectively, are 127 and 24 for single-precision, and 1023 and 53 for double-precision. (2) round to zero the digits below the round bit of the unrounded value are discarded. if the unrounded value is larger than the maximum expressible absolute value, the value will become the maximum expres sible absolute value.
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 85 of 1262 rej09b0437-0100 3.5 floating-point exceptions 3.5.1 fpu exception sources the exception sources are as follows: ? fpu error (e): when fpscr.dn = 0 and a denormalized number is input (no error occurs in the sh2a-fpu) ? invalid operation (v): in case of an invalid operation, such as nan input ? division by zero (z): division with a zero divisor ? overflow (o): when the operation result overflows ? underflow (u): when the operation result underflows ? inexact exception (i): when overflow, underflow, or rounding occurs the fpu exception cause field in fp scr contains bits corresponding to all of above sources e, v, z, o, u, and i, and the fpu exception flag and en able fields in fpscr contain bits corresponding to sources v, z, o, u, and i, but not e. thus, fpu errors cannot be disabled. when an fpu exception occurs, the corresponding bit in the fpu exception cause field is set to 1, and 1 is added to the corresponding bit in the fp u exception flag field. when an fpu exception does not occur, the corresponding bit in the fpu exception cause field is cleared to 0, but the corresponding bit in the fpu excepti on flag field remains unchanged.
section 3 floating-point unit (fpu) rev. 1.00 nov. 14, 2007 page 86 of 1262 rej09b0437-0100 3.5.2 fpu exception handling fpu exception handling is initiated in the following cases: ? fpu error (e): fpscr.dn = 0 and a denormalized number is input (no error occurs in the sh2a-fpu) ? invalid operation (v): fpscr.enab le.v = 1 and invalid operation ? division by zero (z): fpscr.enable.z = 1 and division with a zero divisor ? overflow (o): fpscr.enable.o = 1 and instru ction with possibility of operation result overflow ? underflow (u): fpscr.enable.u = 1 and instruction with possibility of operation result underflow ? inexact exception (i): fpscr.enable .i = 1 and instruction with po ssibility of inexact operation result these possibilities are shown in the individual instruction descriptions. all exception events that originate in the fpu are assigned as the same ex ception event. the meaning of an exception is determined by software by reading from fpscr and interpreting the information it contains. if no bits are set in the fpu exception cause field of fpscr when one or more of bits o, u, i, and v are set in the fpu exception enable field, this in dicates that an actual exception source is not generated. also, the destination register is not changed by any fpu exception handling operation. except for the above, the fpu disables exception handling. in every processing, the bit corresponding to source v, z, o, u, or i is set to 1, and a default value is generated as the operation result. ? invalid operation (v): qnan is generated as the result. ? division by zero (z): infinity with the same sign as the unrounded value is generated. ? overflow (o): when rounding mode = rz, the maximum norma lized number, with th e same sign as the unrounded value, is generated. when rounding mode = rn, infinity with the same sign as the unrounded value is generated. ? underflow (u): zero with the same sign as the unrounded value is generated. ? inexact exception (i): an inexact result is generated.
section 4 cache rev. 1.00 nov. 14, 2007 page 87 of 1262 rej09b0437-0100 section 4 cache 4.1 features ? capacity instruction cache: 8 kbytes operand cache: 8 kbytes ? structure: instructions/data se parated, 4-way set associative ? cache lock function (only for operand cache): way 2 and way 3 are lockable ? line size: 16 bytes ? number of entries: 128 entries/way ? write system: write-back/write-through selectable ? replacement method: least-r ecently-used (lru) algorithm 4.1.1 cache structure the cache separates data and instructions and uses a 4-way set associative system. it is composed of four ways (banks), each of which is divided into an address section and a data section. each of the address and data sections is divided into 128 entries. the data section of the entry is called a line. each line consists of 16 bytes (4 bytes 4). the data capacity per way is 2 kbytes (16 bytes 128 entries), with a total of 8 kbytes in the cache as a whole (4 ways). figure 4.1 shows the operand cache st ructure. the instructio n cache structure is the same as the operand cache structure except for not having the u bit.
section 4 cache rev. 1.00 nov. 14, 2007 page 88 of 1262 rej09b0437-0100 0 1 127 v u lw0 lw1 lw2 lw3 0 1 127 lru 23 (1 + 1 + 21) bits 128 (32 4) bits 6 bits lw0 to lw3: longword data 0 to 3 entry 0 entry 1 entry 127 tag address address array (ways 0 to 3) data array (ways 0 to 3) . . . . . . . . . . . . . . . . . . figure 4.1 operand cache structure (1) address array the v bit indicates whether the entry data is valid. when the v bit is 1, data is valid; when 0, data is not valid. the u bit (only for operand cache) indicates whether the entry has been written to in write-back mode. when the u bit is 1, the entry has been written to; when 0, it has not. the tag address holds the ph ysical address used in the external memory access. it consists of 21 bits (address bits 31 to 11) used for comparison during cache searches. in this lsi, the addresses of the cache-enabled space are h'00000000 to h'1fffffff (see section 7, bus state controller (bsc)), and therefore the upper three bits of the tag address are cleared to 0. the v and u bits are initialized to 0 by a power-on reset but not initialized by a manual reset or in software standby mode. the tag address is not initialized by a power-on reset or manual reset or in software standby mode. (2) data array holds a 16-byte instruction or data. entries are registered in the cache in line units (16 bytes). the data array is not initialized by a power-on reset or manual reset or in software standby mode.
section 4 cache rev. 1.00 nov. 14, 2007 page 89 of 1262 rej09b0437-0100 (3) lru with the 4-way set associative system, up to four instructions or data with the same entry address can be registered in the cache. when an entry is registered, lru shows which of the four ways it is recorded in. there are six lru bits, controlled by hardware. a least-recently-used (lru) algorithm is used to select the way that has been least recently accessed. six lru bits indicate the way to be replaced in case of a cache miss. the relationship between lru and way replacement is shown in table 4.1 when the cache lo ck function (only for operand cache) is not used (concerning th e case where the cache lock function is used, see section 4.2.2, cache control register 2 (ccr2)). if a bit pattern other than those listed in table 4.1 is set in the lru bits by software, the cache will not function correctly. when modifying the lru bits by software, set one of the patterns listed in table 4.1. the lru bits are initialized to b'000000 by a power-on reset but not initialized by a manual reset or in software standby mode. table 4.1 lru and way replacement (cache lock function not used) lru (bits 5 to 0) way to be replaced 000000, 000100, 010100, 100000, 110000, 110100 3 000001, 000011, 001011, 100001, 101001, 101011 2 000110, 000111, 001111, 010110, 011110, 011111 1 111000, 111001, 111011, 111100, 111110, 111111 0
section 4 cache rev. 1.00 nov. 14, 2007 page 90 of 1262 rej09b0437-0100 4.2 register descriptions the cache has the following registers. table 4.2 register configuration register name abbreviation r/w initial value address access size cache control register 1 ccr1 r/w h'00000000 h'fffc1000 32 cache control register 2 ccr2 r/w h'00000000 h'fffc1004 32 4.2.1 cache control register 1 (ccr1) the instruction cache is enabled or disabled using th e ice bit. the icf bit controls disabling of all instruction cache entries. the operand cache is enabled or disabled using the oce bit. the ocf bit controls disabling of all operand cache entries. the wt bit selects either write-through mode or write-back mode for operand cache. programs that change the contents of ccr1 sh ould be placed in a cache-disabled space, and a cache-enabled space should be accessed after reading the contents of ccr1. ccr1 is initialized to h'00000000 by a power-on reset but not initialized by a manual reset or in software standby mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r r r/w r r r/w r r r r r/w r r/w r/w bit: initial value: r/w: bit: initial value: r/w: ---------------- - - - - icf - - ice - - - - ocf - wt oce
section 4 cache rev. 1.00 nov. 14, 2007 page 91 of 1262 rej09b0437-0100 bit bit name initial value r/w description 31 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 icf 0 r/w instruction cache flush writing 1 flushes all instruction cache entries (clears the v and lru bits of all instruction cache entries to 0). always reads 0. write-back to external memory is not performed when the instruction cache is flushed. 10, 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 ice 0 r/w instruction cache enable indicates whether the instruction cache function is enabled/disabled. 0: instruction cache disable 1: instruction cache enable 7 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 ocf 0 r/w operand cache flush writing 1 flushes all operand cache entries (clears the v, u, and lru bits of all operand cache entries to 0). always reads 0. write-back to external memory is not performed when the operand cache is flushed. 2 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 1 wt 0 r/w write through selects write-back mode or write-through mode. 0: write-back mode 1: write-through mode 0 oce 0 r/w operand cache enable indicates whether the operand cache function is enabled/disabled. 0: operand cache disable 1: operand cache enable
section 4 cache rev. 1.00 nov. 14, 2007 page 92 of 1262 rej09b0437-0100 4.2.2 cache control register 2 (ccr2) ccr2 is used to enable or disable the cache locking function for operand cache and is valid in cache locking mode only. in cache locking mode, the lo ck enable bit (the le bit) in ccr2 is set to 1. in non-cache-locking mode, the cache locking function is invalid. when a cache miss occurs in cache locking mode by executing the prefetch instruction (pref @rn), the line of data pointed to by rn is load ed into the cache according to bits 9 and 8 (the w3load and w3lock bits) and bits 1 and 0 (the w2load and w2lock bits) in ccr2. the relationship between the setting of each bit and a way, to be replaced when th e prefetch instruction is executed, are listed in table 4.3. on the other hand, when the prefetch instruction is executed and a cache hit occurs, new data is not fetched and the entry which is already enabled is held. for example, when the prefetch instruction is executed with w3load = 1 and w3lock = 1 specified in cache locking mode while one-line data already exists in way 0 which is specified by rn, a cache hit occurs and data is not fetched to way 3. in the cache access other than the prefetch instruction in cache locking mode, ways to be replaced by bits w3lock and w2lock are restricted. the relationship between the setting of each bit in ccr2 and ways to be replaced are listed in table 4.4. programs that change the contents of ccr2 sh ould be placed in a cache-disabled space, and a cache-enabled space should be accessed after reading the contents of ccr2. ccr2 is initialized to h'00000000 by a power-on reset but not initialized by a manual reset or in software standby mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr/w 0000000000000000 r r r r r r r/w r/w r r r r r r r/w r/w bit: initial value: r/w: bit: initial value: r/w: note: the w3load and w2load bits should not be set to 1 at the same time. * ---------------le ------ w3 load * w3 lock w2 load * w2 lock ------
section 4 cache rev. 1.00 nov. 14, 2007 page 93 of 1262 rej09b0437-0100 bit bit name initial value r/w description 31 to 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 le 0 r/w lock enable controls the cache locking function. 0: not cache locking mode 1: cache locking mode 15 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 8 w3load * w3lock 0 0 r/w r/w way 3 load way 3 lock when a cache miss occurs by the prefetch instruction while w3load = 1 and w3lock = 1 in cache locking mode, the data is always loaded into way 3. under any other condition, the cache miss data is loaded into the way to which lru points. 7 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 0 w2load * w2lock 0 0 r/w r/w way 2 load way 2 lock when a cache miss occurs by the prefetch instruction while w2load = 1 and w2lock =1 in cache locking mode, the data is always loaded into way 2. under any other condition, the cache miss data is loaded into the way to which lru points. note: * the w3load and w2load bits should not be set to 1 at the same time.
section 4 cache rev. 1.00 nov. 14, 2007 page 94 of 1262 rej09b0437-0100 table 4.3 way to be replaced when a cache miss occurs in pref instruction le w3load * w3lock w2load * w2lock way to be replaced 0 x x x x decided by lru (table 4.1) 1 x 0 x 0 decided by lru (table 4.1) 1 x 0 0 1 decided by lru (table 4.5) 1 0 1 x 0 decided by lru (table 4.6) 1 0 1 0 1 decided by lru (table 4.7) 1 0 x 1 1 way 2 1 1 1 0 x way 3 [legend] x: don't care note: * the w3load and w2load bits should not be set to 1 at the same time. table 4.4 way to be replaced when a cache miss occurs in other than pref instruction le w3load * w3lock w2load * w2lock way to be replaced 0 x x x x decided by lru (table 4.1) 1 x 0 x 0 decided by lru (table 4.1) 1 x 0 x 1 decided by lru (table 4.5) 1 x 1 x 0 decided by lru (table 4.6) 1 x 1 x 1 decided by lru (table 4.7) [legend] x: don't care note: * the w3load and w2load bits should not be set to 1 at the same time. table 4.5 lru and way replacement (when w2lock=1 and w3lock=0) lru (bits 5 to 0) way to be replaced 000000, 000001, 000100, 010100, 100000, 100001, 110000, 110100 3 000011, 000110, 000111, 001011, 001111, 010110, 011110, 011111 1 101001, 101011, 111000, 111001, 111011, 111100, 111110, 111111 0
section 4 cache rev. 1.00 nov. 14, 2007 page 95 of 1262 rej09b0437-0100 table 4.6 lru and way replacement (when w2lock=0 and w3lock=1) lru (bits 5 to 0) way to be replaced 000000, 000001, 000011, 001011, 100000, 100001, 101001, 101011 2 000100, 000110, 000111, 001111, 010100, 010110, 011110, 011111 1 110000, 110100, 111000, 111001, 111011, 111100, 111110, 111111 0 table 4.7 lru and way replacement (when w2lock=1 and w3lock=1) lru (bits 5 to 0) way to be replaced 000000, 000001, 000011, 000100, 00 0110, 000111, 001011, 001111, 010100, 010110, 011110, 011111 1 100000, 100001, 101001, 101011, 11 0000, 110100, 111000, 111001, 111011, 111100, 111110, 111111 0
section 4 cache rev. 1.00 nov. 14, 2007 page 96 of 1262 rej09b0437-0100 4.3 operation operations for the operand cache are described here. operations for the instruction cache are similar to those for the operand cache except for the address array not having the u bit, and there being no prefetch operation or write operation, or a write-back buffer. 4.3.1 searching cache if the operand cache is enabled (oce bit in ccr1 is 1), whenever data in a cache-enabled area is accessed, the cache will be searched to see if the de sired data is in the cache. figure 4.2 illustrates the method by which the cache is searched. entries are selected using bits 10 to 4 of the address used to acce ss memory and the tag address of that entry is read. at this time, the upper three bits of the tag address are always cleared to 0. bits 31 to 11 of the address used to access memory are compared with the read tag address. the address comparison uses all four ways. when the comparis on shows a match and the selected entry is valid (v = 1), a cache hit occurs. when the comparison does not show a match or the selected entry is not valid (v = 0), a cache miss occurs. figure 4.2 shows a hit on way 1.
section 4 cache rev. 1.00 nov. 14, 2007 page 97 of 1262 rej09b0437-0100 entry 0 entry 0 entry 1 entry 127 vu lw0 lw1 lw2 lw3 31 10 11 4 3 2 1 0 cmp0 cmp1 cmp2 cmp3 . . . . . . . . . access address tag address address array (ways 0 to 3) data array (ways 0 to 3) [legend] cmp0 to cmp3: comparison circuits 0 to 3 hit signal (way 1) entry selection longword (lw) selection entry 127 entry 1 . . . . . . . . . figure 4.2 cache search scheme
section 4 cache rev. 1.00 nov. 14, 2007 page 98 of 1262 rej09b0437-0100 4.3.2 read access (1) read hit in a read access, data is transferred from the cache to the cpu. lru is upda ted so that the hit way is the latest. (2) read miss an external bus cycle starts and the entry is up dated. the way replaced follows table 4.4. entries are updated in 16-byte units. when the desired data that caused the miss is loaded from external memory to the cache, the data is transferred to th e cpu in parallel with being loaded to the cache. when it is loaded in the cache, the v bit is set to 1, and lru is updated so that the replaced way becomes the latest. in operand cache, the u bit is additionally cleared to 0. when the u bit of the entry to be replaced by updating the entry in write -back mode is 1, the cache update cycle starts after the entry is transferred to the write-back bu ffer. after the cache completes its update cycle, the write-back buffer writes the entry back to th e memory. the write-back unit is 16 bytes. 4.3.3 prefetch operation (only for operand cache) (1) prefetch hit lru is updated so that the hit way becomes the latest. the contents in other caches are not modified. no data is transferred to the cpu. (2) prefetch miss no data is transferred to the cpu. the way to be replaced follows table 4.3. other operations are the same in case of read miss.
section 4 cache rev. 1.00 nov. 14, 2007 page 99 of 1262 rej09b0437-0100 4.3.4 write operation (o nly for operand cache) (1) write hit in a write access in write-back mode, the data is written to the cache and no external memory write cycle is issued. the u bit of the entry written is set to 1 and lru is updated so that the hit way becomes the latest. in write-through mode, the data is written to th e cache and an external memory write cycle is issued. the u bit of the written entry is not upda ted and lru is updated so that the replaced way becomes the latest. (2) write miss in write-back mode, an external bus cycle star ts when a write miss occurs, and the entry is updated. the way to be replaced follows table 4.4. when the u bit of the entr y to be replaced is 1, the cache update cycle starts after th e entry is transferred to the writ e-back buffer. data is written to the cache, the u bit is set to 1, and the v bit is set to 1. lru is updated so that the replaced way becomes the latest. after the cache completes its update cycle, the write-back buffer writes the entry back to the memory. the write-back unit is 16 bytes. in write-through mode, no write to cache occurs in a write miss; the write is only to the external memory. 4.3.5 write-back buffer (only for operand cache) when the u bit of the entry to be replaced in the write-back mode is 1, it must be written back to the external memory. to increase performance, the entry to be replaced is first transferred to the write-back buffer and fetching of new entries to the cache takes priority over writing back to the external memory. after the cache completes to fetch the new entry, the write-back buffer writes the entry back to external memory. during the write-back cycles, the cache can be accessed. the write-back buffer can hold one line of cache data (16 bytes) and its physical address. figure 4.3 shows the configuration of the write-back buffer. longword 0 longword 1 longword 2 longword 3 a (31 to 4) a (31 to 4): longword 0 to 3: physical address written to external memory (upper three bits are 0) one line of cache data to be written to external memory figure 4.3 write-back buffer configuration
section 4 cache rev. 1.00 nov. 14, 2007 page 100 of 1262 rej09b0437-0100 operations in sections 4.3.2 to 4.3.5 are compiled in table 4.8. table 4.8 cache operations cache cpu cycle hit/ miss write-back mode/ write through mode u bit external memory accession (through internal bus) cache contents instructio n cache instruction fetch hit ? ? not generated not renewed miss ? ? cache renewal cycle is generated renewed to new values by cache renewal cycle operand cache prefetch/ read hit either mode is available x not generated not renewed miss write-through mode ? cache renewal cycle is generated renewed to new values by cache renewal cycle write-back mode 0 cache renewal cycle is generated renewed to new values by cache renewal cycle 1 cache renewal cycle is generated. succeedingly write-back cycle in write-back buffer is generated. renewed to new values by cache renewal cycle write hit write-through mode ? write cycle cpu issues is generated. renewed to new values by write cycle the cpu issues write-back mode x not generated renewed to new values by write cycle the cpu issues miss write-through mode ? write cycle cpu issues is generated. not renewed * write-back mode 0 cache renewal cycle is generated renewed to new values by cache renewal cycle. subsequently renewed again to new values in write cycle cpu issues. 1 cache renewal cycle is generated. succeedingly write-back cycle in write-back buffer is generated. renewed to new values by cache renewal cycle. subsequently renewed again to new values in write cycle cpu issues. [legend] x: don't care. note: cache renewal cycle: 16-byte read access, write-back cycle in write-back buffer: 16-byte write access * neither lru renewed. lru is renewed in all other cases.
section 4 cache rev. 1.00 nov. 14, 2007 page 101 of 1262 rej09b0437-0100 4.3.6 coherency of cach e and external memory use software to ensure coherency between the cache and the external memory. when memory shared by this lsi and another device is mapped in the cache-enabled space, operate the memory- mapped cache to invalidate and write back as required.
section 4 cache rev. 1.00 nov. 14, 2007 page 102 of 1262 rej09b0437-0100 4.4 memory-mapped cache to allow software management of the cache, cache contents can be read an d written by means of mov instructions. the instruction cache address array is mapped onto addresses h'f0000000 to h'f07fffff, and the data array onto addresse s h'f1000000 to h'f17fffff. the operand cache address array is mapped onto addresses h'f0800000 to h'f0ffffff, and the data array onto addresses h'f1800000 to h'f1ff ffff. only longword can be used as the access size for the address array and data array, and instruction fetches cannot be performed. 4.4.1 address array to access an address array, the 32 -bit address field (for read/write accesses) and 32-bit data field (for write accesses) must be specified. in the address field, specify the entry address selecting the entry, the w bit for selecting the way, and the a bit for specifyin g the existence of associative operation. in the w bit, b'00 is way 0, b'01 is way 1, b'10 is way 2, and b'11 is way 3. since the access size of the address array is fixed at longword, specify b'00 for bits 1 and 0 of the address. the tag address, lru bits, u bit (only for operand cache), and v bit are specified as data. always specify 0 for the upper three bits (bits 31 to 29) of the tag address. for the address and data formats, see figure 4.4. the following three oper ations are possible for the address array. (1) address array read the tag address, lru bits, u bit (only for operand cache), and v bit are read from the entry address specified by the address and the entry corr esponding to the way. fo r the read operation, associative operation is not performed regardless of whether the associative bit (a bit) specified by the address is 1 or 0. (2) address-array write (non-associative operation) when the associative bit (a bit) in the address fiel d is cleared to 0, write the tag address, lru bits, u bit (only for operand cache) , and v bit, specified by the data fi eld, to the entry address specified by the address and the entry corr esponding to the way. when writi ng to a cache line for which the u bit = 1 and the v bit =1 in the operand cache addr ess array, write the cont ents of the cache line back to memory, then write the ta g address, lru bits, u bit, and v bit specified by the data field. when 0 is written to the v bit, 0 must also be written to the u bit of that entry.
section 4 cache rev. 1.00 nov. 14, 2007 page 103 of 1262 rej09b0437-0100 (3) address-array write (associative operation) when writing with the associative bit (a bit) of th e address field set to 1, the addresses in the four ways for the entry specified by the address field ar e compared with the tag ad dress that is specified by the data field. write the u bit (only for operan d cache) and the v bit specified by the data field to the entry of the way that has a hit. however, the tag address and lru bits remain unchanged. when there is no way that has a hit, noth ing is written and there is no operation. this function is used to invalidate a specific entr y in the cache. when the u bit of the entry that has had a hit is 1 in the operand cache, writing ba ck should be performed. however, when 0 is written to the v bit, 0 must also be written to the u bit of that entry. 4.4.2 data array to access a data array, the 32-bit ad dress field (for read/w rite accesses) and 32-bit data field (for write accesses) must be specified. the address field specifies inform ation for selecting the entry to be accessed; the data field specifies the longwor d data to be written to the data array. specify the entry address for selecting the entry, the l bit indicating the longword position within the (16-byte) line, and the w bit for selecting the way. in the l bit, b'00 is longword 0, b'01 is longword 1, b'10 is longword 2, and b'11 is longwo rd 3. in the w bit, b'00 is way 0, b'01 is way 1, b'10 is way 2, and b'11 is way 3. since the access size of the data array is fixed at longword, specify b'00 for bits 1 and 0 of the address. for the address and data formats, see figure 4.4. the following two operatio ns are possible for the data array. information in the address array is not modified by this operation. (1) data array read the data specified by the l bit in the address is read from th e entry address specified by the address and the entry corr esponding to the way. (2) data array write the longword data specified by the data is written to the position specified by the l bit in the address from the entry address sp ecified by the address and the en try corresponding to the way.
section 4 cache rev. 1.00 nov. 14, 2007 page 104 of 1262 rej09b0437-0100 31 23 22 13 12 11 31 29 28 10 43210 111100000 111100000 111100010 * ---------- * * ---------- * * ---------- * * ---------- * * ---------- * * ---------- * w * lru x x 000 x v e 00 0 31 23 22 13 12 11 10 4 3 2 1 0 31 0 w 0 l 0 31 23 22 13 12 11 10 11 10 9 43210 43210 w * a0 0 31 23 22 13 12 11 31 29 28 10 43210 111100001 111100001 111100011 w * lru x x 000 u v e 00 0 31 23 22 13 12 11 10 4 3 2 1 0 31 0 w 0 l 0 31 23 22 13 12 11 10 11 10 9 43210 43210 w * a00 1. instruction cache 1.1 address array access (a) address specification read access write access (b) data specification (both read and write accesses) 1.2 data array access (both read and write accesses) (a) address specification tag address (28 to 11) entry address (b) data specification longword data * : don't care e: bit 10 of entry address for read, don't care for write x: 0 for read, don't care for write [legend] entry address tag address (28 to 11) entry address entry address entry address entry address longword data 2.2 data array access (both read and write accesses) (a) address specification (b) data specification 2. operand cache 2.1 address array access (a) address specification read access write access (b) data specification (both read and write accesses) figure 4.4 specifying address and data for memory-m apped cache access
section 4 cache rev. 1.00 nov. 14, 2007 page 105 of 1262 rej09b0437-0100 4.4.3 usage examples (1) invalidating specific entries specific cache entries can be invalidated by writing 0 to the entry's v bit in the memory mapping cache access. when the a bit is 1, the tag address specified by the write data is compared to the tag address within the cache select ed by the entry address, and data is written to the bits v and u specified by the write data when a match is found. if no match is found, there is no operation. when the v bit of an entry in the address array is se t to 0, the entry is written back if the entry's u bit is 1. an example when a write data is specified in r0 an d an address is specified in r1 is shown below. ; r0=h'0110 0010; tag address(28-11)=b'0 0001 0001 0000 0000 0, u=0, v=0 ; r1=h'f080 0088; operand cache address array access, entry=b'000 1000, a=1 ; mov.l r0,@r1 (2) reading the data of a specific entry the data section of a specific cache entry can be read by the memory mapping cache access. the longword indicated in the data field of the data array in figure 4.4 is read into the register. an example when an address is specified in r0 and data is read in r1 is shown below. ; r0=h'f100 004c; instruction cache data array access, entry=b'000 0100, ; way=0, longword address=3 ; mov.l @r0,r1 4.4.4 notes 1. programs that access memory -mapped cache should be placed in a cache-disabled space. 2. rewriting the address array contents so that two or more ways are hit simultaneously is prohibited. operation is not guaranteed if the ad dress array contents are changed so that two or more ways are hit simultaneously. 3. memory-mapped cache can be accessed only by the cpu and not by the dmac. registers can be accessed by the cpu and the dmac.
section 4 cache rev. 1.00 nov. 14, 2007 page 106 of 1262 rej09b0437-0100
section 5 exception handling rev. 1.00 nov. 14, 2007 page 107 of 1262 rej09b0437-0100 section 5 exception handling 5.1 overview 5.1.1 types of exception handling and priority exception handling is started by sources, such as resets, address errors, register bank errors, interrupts, and instructions. table 5.1 shows their priorities. when several exception handling sources occur at once, they are proces sed according to the priority shown. table 5.1 types of exception handling and priority order type exception handling priority power-on reset reset manual reset cpu address error address error dmac address error fpu exception integer division exception (division by zero) instruction integer division exception (overflow) bank underflow register bank error bank overflow nmi user break h-udi irq direct memory access controller (dmac) usb2.0 host/function module (usb) compare match timer (cmt) bus state controller (bsc) watchdog timer (wdt) host interface (hif) interrupt on-chip peripheral modules encryption/decryption and forward error correction core conjunction dmac (a- dmac) high low
section 5 exception handling rev. 1.00 nov. 14, 2007 page 108 of 1262 rej09b0437-0100 type exception handling priority ethernet controller (etherc) i 2 c bus interface 3 (iic3) stream interface (stif) serial communication interface with fifo (scif) serial sound interface_0 (ssi_0) serial sound interface_1 (ssi_1) interrupt on-chip peripheral modules sd host interface (sdhi) trap instruction (trapa instruction) general illegal instructions (undefined code) instruction slot illegal instructions (undefined code placed directly after a delayed branch instruction * 1 (including an fpu instruction or fpu-related cpu instruction in fpu module standby mo de), instructions that rewrite the pc * 2 , 32-bit instructions * 3 , resbank instruction, divs instruction, and divu instruction) high low notes: 1. delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf. 2. instructions that rewrite the pc: jmp, jsr, bra, bsr, rts, rte, bt, bf, trapa, bf/s, bt/s, bsrf, braf, jsr/n, rtv/n. 3. 32-bit instructions: band.b, bandnot. b, bclr.b, bld.b, bldnot.b, bor.b, bornot.b, bset.b, bst.b, bxor.b, mov.b@disp12, mov.w@disp12, mov.l@disp12, movi20, movi20s, movu.b, movu.w.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 109 of 1262 rej09b0437-0100 5.1.2 exception handling operations the exception handling sources are detected and begin processi ng according to the timing shown in table 5.2. table 5.2 timing of exception source de tection and start of exception handling exception source timing of source detection and start of handling power-on reset starts when the res pin changes from low to high, when the h-udi reset negate command is set after the h-udi reset assert command has been set, or when the wdt overflows. reset manual reset starts when the wdt overflows. address error detected when instruct ion is decoded and starts when the previous executing instruct ion finishes executing. interrupts detected when instructi on is decoded and starts when the previous executing instruct ion finishes executing. bank underflow starts upon attempted execution of a resbank instruction when saving has not been performed to register banks. register bank error bank overflow in the state where sa ving has been performed to all register bank areas, starts when acceptance of register bank overflow exception has been set by the in terrupt controller (the bove bit in ibnr of the intc is 1) and an interrupt that uses a register bank has occurred and been accepted by the cpu. trap instruction starts from the execution of a trapa instruction. general illegal instructions starts from the decoding of an undefined code (including an fpu instruction or fpu-related cpu instruction in fpu module standby mode) anytime except immediately after a delayed branch instruction (delay slot). slot illegal instructions starts from the decoding of an undefined code placed (including an fpu instruction or fpu-related cpu instruction in fpu module standby mode) immediately after a delayed branch instruction (delay slot), of instructions that rewrite the pc, of 32-bit instructions, of the resbank instruction, of the divs instruction, or of the divu instruction. instructions integer division instructions starts when detecting division-by-zero exception or overflow exception caused by division of the negative maximum value (h'80000000) by ? 1.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 110 of 1262 rej09b0437-0100 when exception handling starts, the cpu operates as follows: (1) exception handling triggered by reset the initial values of the program counter (pc) and stack pointer (sp) are fetched from the exception handling vector table (pc and sp are respectively the h'00000000 and h'00000004 addresses for power-on resets and the h'00000008 and h'0000000c addresses for manual resets). see section 5.1.3, exception handling vector table, for more information. the vector base register (vbr) is then initialized to h'00000000, the interrupt mask level bits (i3 to i0) of the status register (sr) are initialized to h'f (b'1111) , and the bo and cs bits are initialized. the bn bit in ibnr of the interrupt controller (intc) is also initialized to 0. the program begins running from the pc address fetched from the exception handling vector table. (2) exception handling triggered by address errors, register bank errors, interrupts, and instructions sr and pc are saved to the stack indicated by r15. in the case of interrupt exception handling other than nmi or user breaks with usage of the register banks enabled, general registers r0 to r14, control register gbr, system registers ma ch, macl, and pr, and the vector table address offset of the interrupt exception handling to be executed are saved to the register banks. in the case of exception handling due to an address error, register bank error, nmi interrupt, user break interrupt, or instruction, saving to a register bank is not performed. when saving is performed to all register banks, automatic saving to the stack is performed instead of register bank saving. in this case, an interrupt controller setting must have been made so that register bank overflow exceptions are not accepted (the bove bit in ib nr of the intc is 0). if a setting to accept register bank overflow exceptions has been made (the bove bit in ibnr of the intc is 1), register bank overflow exception will be generated. in the case of interrupt exception handling, the interrupt priority level is written to the i3 to i0 bits in sr. in the case of exception handling due to an address error or instruction, the i3 to i0 bits are not affected. the exception service routine start address is then fetched from the exception handling vector table and the program begins running from that address.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 111 of 1262 rej09b0437-0100 5.1.3 exception handling vector table before exception handling begins running, the exception handling vector table must be set in memory. the exception handling vector table stor es the start addresses of exception service routines. (the reset exception handling tabl e holds the initial values of pc and sp.) all exception sources are given different vector numbers and vector table address offsets, from which the vector table addresses are calculated. during exception handling, the start addresses of the exception service routines are fetched from the exception handling vector table, which is indicated by this v ector table address. table 5.3 shows the vector numbers and vector table address offsets. table 5.4 shows how vector table addresses are calculated. table 5.3 exception handling vector table exception sources vector numbers vector table address offset pc 0 h'00000000 to h'00000003 power-on reset sp 1 h'00000004 to h'00000007 pc 2 h'00000008 to h'0000000b manual reset sp 3 h'0000000c to h'0000000f general illegal instructio n 4 h'00000010 to h'00000013 (reserved by system) 5 h'00000014 to h'00000017 slot illegal instruction 6 h'00000018 to h'0000001b 7 h'0000001c to h'0000001f (reserved by system) 8 h'00000020 to h'00000023 cpu address error 9 h'00000024 to h'00000027 dmac address error 10 h'00000028 to h'0000002b nmi 11 h'0000002c to h'0000002f interrupts user break 12 h'00000030 to h'00000033 fpu exception 13 h'00000034 to h'00000037 h-udi 14 h'00000038 to h'0000003b bank overflow 15 h'0000003c to h'0000003f bank underflow 16 h'00000040 to h'00000043
section 5 exception handling rev. 1.00 nov. 14, 2007 page 112 of 1262 rej09b0437-0100 exception sources vector numbers vector table address offset integer division exception (division by zero) 17 h'00000044 to h'00000047 integer division exception (overf low) 18 h'00000048 to h'0000004b (reserved by system) 19 : 31 h'0000004c to h'0000004f : h'0000007c to h'0000007f trap instruction (user vector) 32 : 63 h'00000080 to h'00000083 : h'000000fc to h'000000ff external interrupts (irq), on-chip peripheral module interrupts * 64 : 511 h'00000100 to h'00000103 : h'000007fc to h'000007ff note: * the vector numbers and vector table addre ss offsets for each external interrupt and on- chip peripheral module interrupt are given in table 6.4 in section 6, interrupt controller (intc). table 5.4 calculating exception handling vector table addresses exception source vector table address calculation resets vector table address = (vector table address offset) = (vector number) 4 address errors, register bank errors, interrupts, instructions vector table address = vbr + (vector table address offset) = vbr + (vector number) 4 notes: 1. vector table add ress offset: see table 5.3. 2. vector number: see table 5.3.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 113 of 1262 rej09b0437-0100 5.2 resets 5.2.1 input/output pins table 5.5 shows the reset-related pin configuration. table 5.5 pin configuration pin name symbol i/o function power-on reset res input when this pin is driven low, this lsi shifts to the power- on reset processing 5.2.2 types of reset a reset is the highest-priority exception handling source. there are two kinds of reset, power-on and manual. as shown in table 5.6, the cpu state is initialized in both a power-on reset and a manual reset. the fpu state is initialized by a power-on reset, but not by a manual reset. on-chip peripheral module registers are initialized by a power-on reset, but not by a manual reset. table 5.6 reset states conditions for transition to reset state internal states type res h-udi command mres wdt overflow cpu on-chip peripheral modules, i/o port wrcsr of wdt, frqcr of cpg low ? ? ? initialized initialized initialized high h-udi reset assert command is set ? ? initialized initialized initialized power-on reset high command other than h-udi reset assert is set ? power-on reset initialized initialized not initialized high command other than h-udi reset assert is set low ? initialized not initialized * not initialized manual reset high command other than h-udi reset assert is set high manual reset initialized not initialized * not initialized note: * the bn bit in ibnr of the intc is initialized.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 114 of 1262 rej09b0437-0100 5.2.3 power-on reset (1) power-on reset by means of res pin when the res pin is driven low, this lsi enters the power-on reset state. to reliably reset this lsi, the res pin should be kept at the low level for the duration of the oscillation settling time at power-on or when in software standby mode (when the clock is halted), or at least 20-tcyc (unfixed) when the clock is running. in the power-on reset state, the internal state of the cpu and all the on-chip peripheral module registers are initialized. see appendix a, pin states, for the status of individual pins during the power-on reset state. in the power-on reset state, power-on reset exception handling starts when the res pin is first driven low for a fixed period and then return ed to high. the cpu operates as follows: 1. the initial value (execution start address) of the program counter (pc) is fetched from the exception handling vector table. 2. the initial value of the stack pointer (sp) is fetched from the exception handling vector table. 3. the vector base register (vbr) is cleared to h'00000000, the interrupt mask level bits (i3 to i0) of the status register (sr) are initialized to h'f (b'1111), and the bo and cs bits are initialized. the bn bit in ibnr of the intc is also initialized to 0. 4. the values fetched from the exception handling vector table are set in the pc and sp, and the program begins executing. be certain to always perform power-on reset processing when turnin g the system power on. (2) power-on reset by means of h-udi reset assert command when the h-udi reset assert command is set, this lsi enters the power-on reset state. power-on reset by means of an h-udi reset assert command is equivalent to power-on reset by means of the res pin. setting the h-udi reset negate command cancels the power-on reset state. the time required between an h-udi reset assert command and h-udi reset negate command is the same as the time to keep the res pin low to initiate a power-on re set. in the power-on reset state generated by an h-udi reset assert command, setting the h-udi reset negate command starts power-on reset exception handling. the cpu operates in the same way as when a power-on reset was caused by the res pin.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 115 of 1262 rej09b0437-0100 (3) power-on reset initiated by wdt when a setting is made for a power-on reset to be generated in the wdt?s watchdog timer mode, and wtcnt of the wdt overflows, this lsi enters the power-on reset state. in this case, wrcsr of the wdt and frqcr of the cpg are not initialized by the reset signal generated by the wdt. if a reset caused by the res pin or the h-udi reset assert comma nd occurs simultaneously with a reset caused by wdt overflow, the reset caused by the res pin or the h-udi reset assert command has priority, and the wovf bit in wrcsr is cleared to 0. when power-on reset exception processing is started by the wdt, the cpu operates in the same way as when a power- on reset was caused by the res pin.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 116 of 1262 rej09b0437-0100 5.2.4 manual reset (1) manual reset by means of wdt when a manual reset is set to occur in the wdt?s watchdog timer mode, if the wdt?s wtcnt overflows, the manual reset state is established. in the manual reset state, th e internal state of the cpu is initialized, but the registers in on-c hip peripheral modules are not initialized. when manual reset exception handling is started, the cpu operates as follows. 1. the initial value (execution start address) of the program counter (pc) is fetched from the exception handling vector table. 2. the initial value of the stack pointer (sp) is fetched from the exception handling vector table. 3. the vector base register (vbr) is cleared to h'00000000, the interrupt mask level bits (i3 to i0) of the status register (sr) are initialized to h'f (b'1111), and the bo and cs bits are initialized. the bn bit in ibnr of the intc is also initialized to 0. 4. the values fetched from the exception handling vector table are set in the pc and sp, and the program begins executing. when a manual reset is generated, the bus cycle is retained, but if a manual reset occurs while the bus is released or during dmac burst transfer, manual reset exception handling will be deferred until the cpu acquires the bus. however, if the interval from generation of the manual reset until the end of the bus cycle is equal to or longer than the fixed intern al manual reset interval cycles, the internal manual reset source is ignored instead of being deferred, and manual reset exception handling is not executed. the fpu an d other modules are not initialized.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 117 of 1262 rej09b0437-0100 5.3 address errors 5.3.1 address error sources address errors occur when instructions are fetched or data read or written, as shown in table 5.7. table 5.7 bus cycles and address errors bus cycle type bus master bus cycle description address errors instruction fetched from even address none (normal) instruction fetched from odd address address error occurs instruction fetched from other than on-chip peripheral module space * or h'f0000000 to h'f5ffffff in on-chip ram space * none (normal) instruction fetch cpu instruction fetched from on-chip peripheral module space * or h'f0000000 to h'f5ffffff in on-chip ram space * address error occurs word data accessed from even address none (normal) word data accessed from odd address address error occurs longword data accessed from a longword boundary none (normal) longword data accessed from other than a long-word boundary address error occurs byte or word data accessed in on-chip peripheral module space * none (normal) longword data accessed in 16-bit on-chip peripheral module space * none (normal) data read/write cpu or dmac longword data accessed in 8-bit on-chip peripheral module space * none (normal) note: * see section 7, bus state controller (bsc), for details of the on-chip peripheral module space and on-chip ram space.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 118 of 1262 rej09b0437-0100 5.3.2 address error exception handling when an address error occurs, the bus cycle in wh ich the address error occu rred ends.* when the executing instruction then finishes , address error exception handlin g starts. the cpu operates as follows: 1. the exception service routine start address which corresponds to th e address error that occurred is fetched from the exception handling vector table. 2. the status register (s r) is saved on the stack. 3. the program counter (pc) is saved on the stack. the pc value saved is the start address of the instruction to be executed after the last executed instruction. 4. after jumping to the exception service routine start address fetched from the exception handling vector table, program ex ecution starts. the jump that occurs is not a delayed branch. note: this sequence only applies to address errors in the reading and writing of data. in case of an address error due to instruction fetching, if the bus cycle in wh ich the address error occurred is not completed by the end of step 3 above, address-error exception handling by the cpu is restarted. this continues until the bus cycle is complete.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 119 of 1262 rej09b0437-0100 5.4 register bank errors 5.4.1 register bank error sources (1) bank overflow in the state where saving has al ready been performed to all regi ster bank areas, bank overflow occurs when acceptance of regi ster bank overflow exception has been set by the interrupt controller (the bove bit in ibnr of the intc is set to 1) and an interrupt that uses a register bank has occurred and been accepted by the cpu. (2) bank underflow bank underflow occurs when an attempt is made to execute a re sbank instruction while saving has not been performed to register banks. 5.4.2 register bank e rror exception handling when a register bank error occurs, register bank error exception handling starts. the cpu operates as follows: 1. the exception service routine start address which corresponds to the register bank error that occurred is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the last execut ed instruction for a bank overflow, and the start address of the executed resbank instruction for a bank underflow. to prevent multiple interrupts from occurring at a bank overflow, the interrupt priority level that caused the bank overflow is written to the interrupt mask level bits (i3 to i0) of the status register (sr). 4. after jumping to the exception service rout ine start address fetche d from the exception handling vector table, program ex ecution starts. the jump that occurs is not a delayed branch.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 120 of 1262 rej09b0437-0100 5.5 interrupts 5.5.1 interrupt sources table 5.8 shows the sources that start up interrupt exception handling. these are divided into nmi, user breaks, h-udi, irq, pint , and on-chip peripheral modules. table 5.8 interrupt sources type request source number of sources nmi nmi pin (external input) 1 user break user break controller (ubc) 1 h-udi high-performance user debugging interface (h-udi) 1 irq irq0 to irq7 pins (external input) 8 direct memory access controller (dmac) 16 ethernet controller (etherc) 1 compare match timer (cmt) 2 bus state controller (bsc) 1 watchdog timer (wdt) 1 encryption/decryption and forward error correction core conjunction dmac (a-dmac) 7 stream interface (stif) 2 host interface (hif) 2 serial sound interface_0 (ssi_0) 1 serial sound interface_1 (ssi_1) 1 sd host interface (sdhi) 3 usb2.0 host/function module (usb) 1 i 2 c bus interface 3 (iic3) 5 on-chip peripheral module serial communication inte rface with fifo (scif) 16 each interrupt source is allocated a different vector number and vect or table offset. see table 6.4 in section 6, interrupt controller (intc), for more information on vector numbers and vector table address offsets.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 121 of 1262 rej09b0437-0100 5.5.2 interrupt priority level the interrupt priority order is predetermined. when multiple interrupts occur simultaneously (overlap), the interrupt controller (intc) determines their relative priorities and starts processing according to the results. the priority order of interrupts is expressed as prio rity levels 0 to 16, with priority 0 the lowest and priority 16 the highest. the nmi interrupt has priority 16 and cannot be masked, so it is always accepted. the user break inte rrupt and h-udi interrupt priority level is 15. priority levels of irq interrupts, and on-chip peripheral module interrupts can be set freely using the interrupt priority registers 01, 02, and 06 to 16 (ipr01, ipr02, and ipr06 to ipr16) of the intc as shown in table 5.9. the priority levels that can be set are 0 to 15. level 16 cannot be set. see section 6.3.1, interrupt priority registers 01, 02, 06 to 16 (ipr01, ipr02, ipr06 to ipr16), for details of ipr01, ipr02, and ipr05 to ipr14. table 5.9 interrupt priority order type priority level comment nmi 16 fixed priority level. cannot be masked. user break 15 fixed priority level. h-udi 15 fixed priority level. irq on-chip peripheral module 0 to 15 set with interrupt priority registers 01, 02, and 05 to 14 (ipr01, ipr02, and ipr05 to ipr14).
section 5 exception handling rev. 1.00 nov. 14, 2007 page 122 of 1262 rej09b0437-0100 5.5.3 interrupt exception handling when an interrupt occurs, its priority level is ascertained by the interrupt controller (intc). nmi is always accepted, but other interr upts are only accepted if they ha ve a priority level higher than the priority level set in the interrupt mask leve l bits (i3 to i0) of the status register (sr). when an interrupt is accepted, interrupt excep tion handling begins. in interrupt exception handling, the cpu fetches the ex ception service routin e start address which corresponds to the accepted interrupt from the exception handling vector table, and sa ves sr and the program counter (pc) to the stack. in the case of interrupt exception handling other than nmi or user breaks with usage of the register banks enabled, general registers r0 to r14, control register gbr, system registers mach, macl, and pr, and the vector ta ble address offset of the interrupt exception handling to be executed are saved in the register ba nks. in the case of except ion handling due to an address error, nmi interrupt, user break interrupt, or instruction, saving is not performed to the register banks. if saving has been performed to all register banks (0 to 14), automatic saving to the stack is performed instead of register bank saving. in this case, an interrupt controller setting must have been made so that register bank overfl ow exceptions are not accept ed (the bove bit in ibnr of the intc is 0). if a se tting to accept register bank overfl ow exceptions has been made (the bove bit in ibnr of the intc is 1), register bank overflow exception occurs. next, the priority level value of the accepted interrupt is written to the i3 to i0 bits in sr. for nmi, however, the priority level is 16, but the value set in the i3 to i0 bits is h'f (level 15). then, after jumping to the start address fetched from the exception handling vector table, program execution starts. the jump that occurs is not a delayed branch. see section 6.6, operation, for further details of interrupt exception handling.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 123 of 1262 rej09b0437-0100 5.6 exceptions triggered by instructions 5.6.1 types of exceptions triggered by instructions exception handling can be triggered by trap instructions, general illegal instructions, slot illegal instructions, and integer division exceptions, as shown in table 5.10. table 5.10 types of exceptions triggered by instructions type source instruction comment trap instruction trapa slot illegal instructions undefined code placed immediately after a delayed branch instruction (delay slot) (including the fpu instruction and fpu-related cpu instruction in fpu module standby mode), instructions that rewrite the pc, 32-bit instructions, resbank instruction, divs instruction, and divu instruction delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf instructions that rewrite the pc: jmp, jsr, bra, bsr, rts, rte, bt, bf, trapa, bf/s, bt/s, bsrf, braf, jsr/n, rtv/n 32-bit instructions: band.b, bandnot.b, bclr.b, bld.b, bldnot.b, bor.b, bornot.b, bset.b, bst.b, bxor.b, mov.b@disp12, mov.w@disp12, mov.l@disp12, movi20, movi20s, movu.b, movu.w. general illegal instructions undefined code anywhere besides in a delay slot (including the fpu instruction and fpu- related cpu instruction in fpu module standby mode) division by zero divu, divs integer division exceptions negative maximum value ( ? 1) divs floating-point operation instruction instructions that will cause invalid operation exception or divide by zero exception defined in the ieee754 standard, and instructions that may cause overflow exception, underflow exception, or incorrectness exception fadd, fsub, fmul, fdiv, fmac, fcmp/eq, fcmp/gt, float, ftrc,fcnvds, fcnvsd, fsqrt
section 5 exception handling rev. 1.00 nov. 14, 2007 page 124 of 1262 rej09b0437-0100 5.6.2 trap instructions when a trapa instruction is executed, trap instruction exception handling starts. the cpu operates as follows: 1. the exception service routine start address wh ich corresponds to the vector number specified in the trapa instruction is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the trapa instruction. 4. after jumping to the exception service routine start address fetched from the exception handling vector table, program ex ecution starts. the jump that occurs is not a delayed branch. 5.6.3 slot illegal instructions an instruction placed immedi ately after a delayed branch instructio n is said to be placed in a delay slot. when the instruction placed in the delay slot is an undefined code (including an fpu instruction or fpu-related cpu instruction in fpu module standby mode), an instruction that rewrites the pc, a 32-bit instruction, an resban k instruction, a divs instruction, or a divu instruction, slot illegal exception handling starts if such kind of instruction is decoded. when the fpu is in the module standby state, the floating-point operation instruction and fpu-related cpu instruction are handled as an undefined code; when such an instruction is placed in the delay slot, slot illegal exception handling starts if the instruction is decoded. the cpu operates as follows: 1. the exception service routine start address is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the jump address of the delayed branch instruction immediately before the undefined code, the instruction that rewrites the pc, the 32-bit instruction, the resbank inst ruction, the divs instruction, or the divu instruction. 4. after jumping to the exception service routine start address fetched from the exception handling vector table, program ex ecution starts. the jump that occurs is not a delayed branch. 5.6.4 general illegal instructions when an undefined code (including an fpu instruction or fpu-related cpu instruction in fpu module standby mode) placed anywhere other than immediately after a delayed branch instruction (i.e., in a delay slot) is decoded, general illegal instruction exception handling starts. when the fpu is in the module standby state, the floating-point operation instruction and fpu-related cpu
section 5 exception handling rev. 1.00 nov. 14, 2007 page 125 of 1262 rej09b0437-0100 instruction are handled as an undefined code; when such an instruction is placed anywhere other than immediately after a delayed branch instruction (i .e., in a delay slot), general illegal instruction exception handling starts if the instruction is decoded. the cpu handles general illegal instruction exception in the same way as slot illegal instruction exception. unlike processing of slot illegal instruction exception, however, the program counter value stored is the start ad dress of the undefined code. 5.6.5 integer division instructions when an integer division instruction performs division by zero or the result of integer division overflows, integer division instruction exception handling starts. the instructions that may become the source of division-by-zero exception are divu and divs. the only source instruction of overflow exception is divs, and overflow exception occurs only when the negative maximum value is divided by ? 1. the cpu operates as follows: 1. the exception service routin e start address which corresponds to the integer division instruction exception that occurred is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the start address of the integer division instruction at which the exception occurred. 4. after jumping to the exception service routine start address fetched from the exception handling vector table, program ex ecution starts. the jump that occurs is not a delayed branch.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 126 of 1262 rej09b0437-0100 5.6.6 floating-point operation instruction in the floating-point status/control register (fpscr), fpu exception occurs if the v, z, o, u, or i bit in the fpu exception enable field (enable) is set. this indicates that a floating-point operation instruction has caused any of the exceptions defined in the ieee754 standard: invalid operation exception, overflow exception (likely instruction), underflow exception (likely instruction), or incorrectness exception (likely instruction). the following floating-point operation instructions may become exception sources: fadd, fsub, fmul, fdiv, fmac, fcmp/eq, fcmp/gt, float, ftrc, fcnvds, fcnvsd, fsqrt an fpu exception occurs only when the correspondi ng enable bit is set. when the fpu detects an exception source, the fpu di scontinues its operation and notifies the cpu of the occurrence of an exception. when exception handling is started, the cpu operates as follows: 1. the start address of the exception service rou tine corresponding to the fpu exception that has occurred is fetched from the exception handling vector table. 2. the status register (sr) is saved in the stack. 3. the program counter (pc) is saved in the stac k. the start address of the instruction following the instruction executed last is the value to be saved in the pc. 4. to start executing the program, a jump occu rs to the start address of the exception service routine fetched from the exception handling vector table. this jump is not a delayed branch. the fpu exception flag filed (flag) in the fpscr is always updated irrespective of whether it is capable of accepting fpu ex ceptions and remains set until it is cleared explicitly by an instruction from the user. the fpu exception source field (c ause) in the fpscr changes each time an fpu instruction is executed. when the fpu exception enable fi eld (enable) in the fpscr is se t and when the qis bit in the fpscr is set, fpu excepti on starts if qnan or is entered into the source of the floating-point operation instruction.
section 5 exception handling rev. 1.00 nov. 14, 2007 page 127 of 1262 rej09b0437-0100 5.7 when exception sources are not accepted when an address error, fpu exception, register bank error (overflow), or interrupt is generated immediately after a delayed branch instruction, it is sometimes not accepted immediately but stored instead, as shown in table 5.11. when this happens, it will be accepted when an instruction that can accept the exception is decoded. table 5.11 exception source generation imme diately after delayed branch instruction exception source point of occurrence address error fpu exception register bank error (overflow) interrupt immediately after a delayed branch instruction * not accepted not accepted not accepted not accepted note: * delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf
section 5 exception handling rev. 1.00 nov. 14, 2007 page 128 of 1262 rej09b0437-0100 5.8 stack status after exception handling ends the status of the stack after exception handling ends is as shown in table 5.12. table 5.12 stack status af ter exception handling ends exception type stack status address error 32 bits 32 bits sr address of instruction after executed instruction sp interrupt 32 bits 32 bits sr address of instruction after executed instruction sp register bank error (overflow) 32 bits 32 bits sr address of instruction after executed instruction sp register bank error (underflow) 32 bits 32 bits sr start address of relevant resbank instruction sp trap instruction 32 bits 32 bits sr address of instruction after trapa instruction sp slot illegal instruction 32 bits 32 bits sr jump destination address of delayed branch instruction sp
section 5 exception handling rev. 1.00 nov. 14, 2007 page 129 of 1262 rej09b0437-0100 exception type stack status general illegal instruction 32 bits 32 bits sr start address of general illegal instruction sp integer division instruction 32 bits 32 bits sr start address of relevant integer division instruction sp fpu exception 32 bits 32 bits sr address of the instruction following the instruction executed sp
section 5 exception handling rev. 1.00 nov. 14, 2007 page 130 of 1262 rej09b0437-0100 5.9 usage notes 5.9.1 value of stack pointer (sp) the value of the stack pointer must always be a mu ltiple of four. if it is not, an address error will occur when the stack is accessed during exception handling. 5.9.2 value of vector base register (vbr) the value of the vector base regist er must always be a multiple of four. if it is not, an address error will occur when the stack is acce ssed during exception handling. 5.9.3 address errors caused by stacki ng of address error exception handling when the stack pointer is not a multiple of four, an address error will occur during stacking of the exception handling (interrupts, etc.) and address error exception handling will start up as soon as the first exception handling is ended. address erro rs will then also occur in the stacking for this address error exception handling. to ensure that address error exce ption handling does not go into an endless loop, no address erro rs are accepted at that point. this allows program control to be shifted to the address error exception serv ice routine and enables error processing. when an address error occurs during exception handling stacking, the stacking bus cycle (write) is executed. during stacking of th e status register (sr) and program counter (pc), the sp is decremented by 4 for both, so the value of sp will not be a multiple of four after the stacking either. the address value output during stacking is the sp value, so the address where the error occurred is itself output. this means the write data stacked will be undefined.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 131 of 1262 rej09b0437-0100 section 6 interrupt controller (intc) the interrupt controller (intc) ascertains the prior ity of interrupt sources and controls interrupt requests to the cpu. the intc registers set the order of priority of each interrupt, allowing the user to process interr upt requests according to the user-set priority. 6.1 features ? 16 levels of interrupt priority can be set by setting the nine interrupt priority registers, the priorities of irq interrupts, and on-chip peripheral module interrupts can be selected from 16 levels for request sources. ? nmi noise canceler function an nmi input-level bit indicates the nmi pin state. by reading this bit in the interrupt exception service routine, the pin state can be checked, enabling it to be used as the noise canceler function. ? register banks this lsi has register banks that enable register saving and restoration required in the interrupt processing to be performed at high speed.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 132 of 1262 rej09b0437-0100 figure 6.1 shows a block diagram of the intc. ubc h-udi dmac cmt bsc wdt mtu2 mtu2s poe2 adc iic3 scif ubc: h-udi: dmac: cmt: bsc: wdt: etherc: a-dmac: hif: usb: stif: ssi: sdhi: iic3: scif: icr0: icr1: icr2: irqrr: pinter: pirr: ibcr: ibnr: ipr01, ipr02, ipr05 to ipr14: sr cpu module bus i3 i2 i1 i0 pinter ibcr ipr01, ipr02, ipr05 to ipr14 icr0 icr2 pirr ibnr icr1 irqrr pint7 to pint0 irq7 to irq0 nmi irqout ipr input control intc (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) priority identifier com- parator interrupt request bus interface peripheral bus user break controller high-performance user debugging interface direct memory access controller compare match timer bus state controller watchdog timer ethernet controller dmac with encryption/decryption and forward error correction core host interface usb2.0 host/function module stream interface serial sound interface sd host interface i 2 c bus interface 3 serial communication interface with fifo interrupt control register 0 interrupt control register 1 interrupt control register 2 irq interrupt request register pint interrupt enable register pint interrupt request register bank control register bank number register interrupt priority registers 01, 02, 05 to 14 [legend] figure 6.1 block diagram of intc
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 133 of 1262 rej09b0437-0100 6.2 input/output pins table 6.1 shows the pin configuration of the intc. table 6.1 pin configuration pin name symbol i/o function nonmaskable interrupt input pin nmi input input of nonmaskable interrupt request signal interrupt request input pins irq7 to irq0 input input of maskable interrupt request signals
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 134 of 1262 rej09b0437-0100 6.3 register descriptions the intc has the following regist ers. these registers are used to set the interrupt priorities and control detection of the external interrupt input signal. table 6.2 register configuration register name abbreviation r/w initial value address access size interrupt control register 0 icr0 r/w * 1 h'fffe0800 16, 32 interrupt control register 1 icr1 r/w h'0000 h'fffe0802 16, 32 irq interrupt request register irqrr r/(w) * 2 h'0000 h'fffe0806 16, 32 bank control register ib cr r/w h'0000 h'fffe080c 16, 32 bank number register ibnr r/w h'0000 h'fffe080e 16, 32 interrupt priority register 01 ipr01 r/w h'0000 h'fffe0818 16, 32 interrupt priority register 02 ipr02 r/w h'0000 h'fffe081a 16, 32 interrupt priority register 06 ipr06 r/w h'0000 h'fffe0c00 16, 32 interrupt priority register 07 ipr07 r/w h'0000 h'fffe0c02 16, 32 interrupt priority register 08 ipr08 r/w h'0000 h'fffe0c04 16, 32 interrupt priority register 09 ipr09 r/w h'0000 h'fffe0c06 16, 32 interrupt priority register 10 ipr10 r/w h'0000 h'fffe0c08 16, 32 interrupt priority register 11 ipr11 r/w h'0000 h'fffe0c0a 16, 32 interrupt priority register 12 ipr12 r/w h'0000 h'fffe0c0c 16, 32 interrupt priority register 13 ipr13 r/w h'0000 h'fffe0c0e 16, 32 interrupt priority register 14 ipr14 r/w h'0000 h'fffe0c10 16, 32 interrupt priority register 15 ipr15 r/w h'0000 h'fffe0c12 16, 32 interrupt priority register 16 ipr16 r/w h'0000 h'fffe0c14 16, 32 notes: 1. when the nmi pin is high, bec omes h'8000; when lo w, becomes h'0000. 2. only 0 can be written after reading 1, to clear the flag.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 135 of 1262 rej09b0437-0100 6.3.1 interrupt priority registers 01, 02, 06 to 16 (i pr01, ipr02, ip r06 to ipr16) ipr01, ipr02, and ipr06 to ipr16 are 16-bit readable/writable registers in which priority levels from 0 to 15 are set for irq interrupts, pint interrupts, and on-chip peripheral module interrupts. table 6.3 shows the corres pondence between the interrupt request sources and the bits in ipr01, ipr02, and ipr06 to ipr16. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: table 6.3 interrupt request sources and ipr01, ipr02, and ipr06 to ipr16 register name bits 15 to 12 bits 11 to 8 bits 7 to 4 bits 3 to 0 interrupt priority register 01 irq0 irq1 irq2 irq3 interrupt priority register 02 irq4 irq5 irq6 irq7 interrupt priority register 06 dmac0 dmac1 dmac2 dmac3 interrupt priority register 07 dmac4 dmac5 dmac6 dmac7 interrupt priority register 08 usb reserved cmt0 cmt1 interrupt priority register 09 bsc wdt hif0 hif1 interrupt priority register 10 adm1i c[0]i c[1]i reserved interrupt priority register 11 reserved reserved feci reserved interrupt priority register 12 etc iic3 reserved stif0 interrupt priority register 13 stif1 scif0 scif1 scif2 interrupt priority register 14 reserved reserved reserved ssi0
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 136 of 1262 rej09b0437-0100 register name bits 15 to 12 bits 11 to 8 bits 7 to 4 bits 3 to 0 interrupt priority register 15 ssi1 reserved reserved reserved interrupt priority register 16 reserved sdhi reserved reserved as shown in table 6.3, by setting the 4-bit groups (bits 15 to 12, bits 11 to 8, bits 7 to 4, and bits 3 to 0) with values from h'0 (0000) to h'f (1111), the priority of each corresponding interrupt is set. setting of h'0 means priority level 0 (the lowest level) and h'f means priority level 15 (the highest level). ipr01, ipr02, and ipr06 to ipr16 are in itialized to h'0000 by a power-on reset.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 137 of 1262 rej09b0437-0100 6.3.2 interrupt contro l register 0 (icr0) icr0 is a 16-bit register that sets the input signa l detection mode for the external interrupt input pin nmi, and indicates the input level at the nmi pin. icr0 is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 * 000000000000000 rrrrrrrr/wrrrrrrrr bit: initial value: r/w: note: 1 when the nmi pin is high, and 0 when the nmi pin is low. * nmil - - - - - - nmie - - - - - - - - bit bit name initial value r/w description 15 nmil * r nmi input level sets the level of the signal input at the nmi pin. the nmi pin level can be obtained by reading this bit. this bit cannot be modified. 0: low level is input to nmi pin 1: high level is input to nmi pin 14 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 nmie 0 r/w nmi edge select selects whether the falling or rising edge of the interrupt request signal on the nmi pin is detected. 0: interrupt request is detected on falling edge of nmi input 1: interrupt request is detected on rising edge of nmi input 7 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 138 of 1262 rej09b0437-0100 6.3.3 interrupt contro l register 1 (icr1) icr1 is a 16-bit register that specifies the detection mode for external interrupt input pins irq7 to irq0 individually: low level, falling edge, rising edge, or both edges. icr1 is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: irq71s irq70s irq61s irq60s irq51s irq50s irq41s irq40s irq31s irq30s irq21s irq20s irq11s irq10s irq01s irq00s bit bit name initial value r/w description 15 irq71s 0 r/w 14 irq70s 0 r/w 13 irq61s 0 r/w 12 irq60s 0 r/w 11 irq51s 0 r/w 10 irq50s 0 r/w 9 irq41s 0 r/w 8 irq40s 0 r/w 7 irq31s 0 r/w 6 irq30s 0 r/w 5 irq21s 0 r/w 4 irq20s 0 r/w 3 irq11s 0 r/w 2 irq10s 0 r/w 1 irq01s 0 r/w 0 irq00s 0 r/w irq sense select these bits select whether interrupt signals corresponding to pins irq7 to irq0 are detected by a low level, falling edge, rising edge, or both edges. 00: interrupt request is detected on low level of irqn input 01: interrupt request is detected on falling edge of irqn input 10: interrupt request is detected on rising edge of irqn input 11: interrupt request is detected on both edges of irqn input [legend] n = 7 to 0
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 139 of 1262 rej09b0437-0100 6.3.4 irq interrupt re quest register (irqrr) irqrr is a 16-bit register that indicates interrupt requests from external input pins irq7 to irq0. if edge detection is set for the irq7 to irq0 inte rrupts, writing 0 to the irq7f to irq0f bits after reading irq7f to irq0f = 1 can cels the retained interrupts. irqrr is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 00000000 r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: only 0 can be written to clear the flag after 1 is read. * bit: initial value: r/w: 00000000 rrrrrrrr - - - - - - - - irq7f irq6f irq5f irq4f irq3f irq2f irq1f irq0f bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 140 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 irq7f 0 r/(w) * 6 irq6f 0 r/(w) * 5 irq5f 0 r/(w) * 4 irq4f 0 r/(w) * 3 irq3f 0 r/(w) * 2 irq2f 0 r/(w) * 1 irq1f 0 r/(w) * 0 irq0f 0 r/(w) * irq interrupt request these bits indicate the status of the irq7 to irq0 interrupt requests. level detection: 0: irqn interrupt request has not occurred [clearing condition] ? irqn input is high 1: irqn interrupt has occurred [setting condition] ? irqn input is low edge detection: 0: irqn interrupt request is not detected [clearing conditions] ? cleared by reading irqnf while irqnf = 1, then writing 0 to irqnf ? cleared by executing irqn interrupt exception handling 1: irqn interrupt request is detected [setting condition] ? edge corresponding to irqn1s or irqn0s of icr1 has occurred at irqn pin [legend] n = 7 to 0
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 141 of 1262 rej09b0437-0100 6.3.5 bank control register (ibcr) ibcr is a 16-bit register that enables or disables use of register banks for each interrupt priority level. ibcr is initialized to h'0000 by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r bit: initial value: r/w: e15 e14 e13 e12 e11 e10 e9 e8 e7 e6 e5 e4 e3 e2 e1 - bit bit name initial value r/w description 15 e15 0 r/w 14 e14 0 r/w 13 e13 0 r/w 12 e12 0 r/w 11 e11 0 r/w 10 e10 0 r/w 9 e9 0 r/w 8 e8 0 r/w 7 e7 0 r/w 6 e6 0 r/w 5 e5 0 r/w 4 e4 0 r/w 3 e3 0 r/w 2 e2 0 r/w 1 e1 0 r/w enable these bits enable or disable use of register banks for interrupt priority levels 15 to 1. however, use of register banks is always disabled for the user break interrupts. 0: use of register banks is disabled 1: use of register banks is enabled 0 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 142 of 1262 rej09b0437-0100 6.3.6 bank number register (ibnr) ibnr is a 16-bit register that enables or disables use of register banks and register bank overflow exception. ibnr also indicates th e bank number to which saving is performed next through the bits bn3 to bn0. ibnr is initialized to h'0000 by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r r r r r r r r r r r r r bit: initial value: r/w: be[1:0] bove - - - - - - - - - bn[3:0] bit bit name initial value r/w description 15, 14 be[1:0] 00 r/w r egister bank enable these bits enable or disable use of register banks. 00: use of register banks is di sabled for all interrupts. the setting of ibcr is ignored. 01: use of register banks is enabled for all interrupts except nmi and user break. the setting of ibcr is ignored. 10: reserved (setting prohibited) 11: use of register banks is c ontrolled by the setting of ibcr. 13 bove 0 r/w register bank overflow enable enables of disables register bank overflow exception. 0: generation of register bank overflow exception is disabled 1: generation of register bank overflow exception is enabled 12 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 to 0 bn[3:0] 0000 r bank number these bits indicate the bank number to which saving is performed next. when an interrupt using register banks is accepted, saving is performed to the register bank indicated by these bits, and bn is incremented by 1. after bn is decremented by 1 due to execution of a resbank (restore from register bank) instruction, restoration from the register bank is performed.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 143 of 1262 rej09b0437-0100 6.4 interrupt sources there are five types of interrupt sources: nmi, us er break, h-udi, irq, and on-chip peripheral modules. each interrupt has a priority level (0 to 16), with 0 the lowest and 16 the highest. when set to level 0, that interrupt is masked at all times. 6.4.1 nmi interrupt the nmi interrupt has a pr iority level of 16 and is accepted at all times. nmi interrupt requests are edge-detected, and the nmi edge select bit (nmie) in interrupt control register 0 (icr0) selects whether the rising edge or falling edge is detected. though the priority level of the nmi interrupt is 16, the nmi interrupt exception handling sets the interrupt mask level bits (i3 to i0) in the status register (sr) to level 15. 6.4.2 user break interrupt a user break interrupt which occurs when a break condition set in the user break controller (ubc) matches has a priority level of 15. the user break interrupt exception handling sets the i3 to i0 bits in sr to level 15. for user break interrupts, see section 25, user break controller (ubc). 6.4.3 h-udi interrupt the high-performance user debugging interface (h-udi) interrupt has a priority level of 15, and occurs at serial input of an h-udi interrupt instruction. h-udi interrupt requests are edge- detected and retained until they are accepted. the h-udi interrupt ex ception handling sets the i3 to i0 bits in sr to level 15. for h-udi interrupts, see section 26, high-performance user debugging interface (h-udi).
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 144 of 1262 rej09b0437-0100 6.4.4 irq interrupts irq interrupts are input from pins irq7 to irq0 . for the irq interrupts, low-level, falling-edge, rising-edge, or both-edge detection can be selected individually for each pin by the irq sense select bits (irq71s to irq01s and irq70s to ir q00s) in interrupt control register 1 (icr1). the priority level can be set individually in a range from 0 to 15 for each pin by interrupt priority registers 01 and 02 (ipr01 and ipr02). when using low-level sensing for irq interrupts, an interrupt request signal is sent to the intc while the irq7 to irq0 pins are low. an interrupt request signal is stopped being sent to the intc when the irq7 to irq0 pins are driven high. the status of the interrupt requests can be checked by reading the irq interrupt request bits (irq7f to irq0f) in the irq interrupt request register (irqrr). when using edge-sensing for irq interrupts, an interrupt request is detected due to change of the irq7 to irq0 pin states, and an interrupt request signal is sent to the intc. the result of irq interrupt request detection is retained until th at interrupt request is accepted. whether irq interrupt requests have been detected or not can be checked by reading the irq7f to irq0f bits in irqrr. writing 0 to these bits after reading them as 1 clears the result of irq interrupt request detection. the irq interrupt exception handling sets the i3 to i0 bits in sr to the priority level of the accepted irq interrupt. when returning from irq interrupt exception service routine, execute the rte instruction after confirming that the interrupt request has been cleared by the irq interrupt request register (irqrr) so as not to accidentally r eceive the interrupt request again.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 145 of 1262 rej09b0437-0100 6.4.5 on-chip peripheral module interrupts on-chip peripheral module interrupts are generated by the following on-chip peripheral modules: ? direct memory access controller (dmac) ? ethernet controller (etherc) ? compare match timer (cmt) ? bus state controller (bsc) ? watchdog timer (wdt) ? dmac with encryption/decryption and forward error correction core (a-dmac) ? stream interface (stif) ? host interface (hif) ? serial sound interface (ssi) ? sd host interface (sdhi) ? usb2.0 host/function module (usb) ? i 2 c bus interface 3 (iic3) ? serial communication inte rface with fifo (scif) as every source is assigned a different interrupt v ector, the source does not n eed to be identified in the exception service routine. a priority level in a range from 0 to 15 can be set for each module by interrupt priority registers 06 to 16 (ipr06 to ipr16). the on-chip peripheral module interrupt exception handling sets the i3 to i0 bits in sr to the priority level of the accepted on-chip peripheral module interrupt.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 146 of 1262 rej09b0437-0100 6.5 interrupt exception handling vector table and priority table 6.4 lists interrupt sources and their vector numbers, vector table address offsets, and interrupt priorities. each interrupt source is allocated a different vector number and vect or table address offset. vector table addresses are calculated from the vector numbers and vector table address offsets. in interrupt exception handling, the interrupt exceptio n service routine start ad dress is fetched from the vector table indicated by the vector table addr ess. for details of calculation of the vector table address, see table 5.4, calculating exception ha ndling vector table addresses, in section 5, exception handling. the priorities of irq interrupts, and on-chip peripheral module interrupts can be set freely between 0 and 15 for each pin or module by setting in terrupt priority registers 01, 02, and 06 to 16 (ipr01, ipr02, and ipr06 to ipr16). however, if two or more interrupts specified by the same ipr among ipr06 to ipr16 occur, the priorities are defined as shown in the ipr setting unit internal priority of table 6.4, and the priorities cannot be changed. a power-on reset assigns priority level 0 to irq interrupts, and on-chip peripheral module interrupts. if the same priority level is assigned to two or more interrupt sources and interrupts from those sources occur simultaneously, they are processed by the default priorities indicated in table 6.4.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 147 of 1262 rej09b0437-0100 table 6.4 interrupt exception ha ndling vectors and priorities interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority nmi 11 h'0000002c to h'0000002f 16 ? ? high user break 12 h'00000030 to h'00000033 15 ? ? h-udi 14 h'00000038 to h'0000003b 15 ? ? irq0 64 h'00000100 to h'00000103 0 to 15 (0) ipr01 (15 to 12) ? irq1 65 h'00000104 to h'00000107 0 to 15 (0) ipr01 (11 to 8) ? irq2 66 h'00000108 to h'0000010b 0 to 15 (0) ipr01 (7 to 4) ? irq3 67 h'0000010c to h'0000010f 0 to 15 (0) ipr01 (3 to 0) ? irq4 68 h'00000110 to h'00000113 0 to 15 (0) ipr02 (15 to 12) ? irq5 69 h'00000114 to h'00000117 0 to 15 (0) ipr02 (11 to 8) ? irq6 70 h'00000118 to h'0000011b 0 to 15 (0) ipr02 (7 to 4) ? irq irq7 71 h'0000011c to h'0000011f 0 to 15 (0) ipr02 (3 to 0) ? dei0 108 h'000001b0 to h'000001b3 1 dmac0 hei0 109 h'000001b4 to h'000001b7 0 to 15 (0) ipr06 (15 to 12) 2 dei1 112 h'000001c0 to h'000001c3 1 dmac1 hei1 113 h'000001c4 to h'000001c7 0 to 15 (0) ipr06 (11 to 8) 2 low
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 148 of 1262 rej09b0437-0100 interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority dei2 116 h'000001d0 to h'000001d3 1 high dmac2 hei2 117 h'000001d4 to h'000001d7 0 to 15 (0) ipr06 (7 to 4) 2 dei3 120 h'000001e0 to h'000001e3 1 dmac3 hei3 121 h'000001e4 to h'000001e7 0 to 15 (0) ipr06 (3 to 0) 2 dei4 124 h'000001f0 to h'000001f3 1 dmac4 hei4 125 h'000001f4 to h'000001f7 0 to 15 (0) ipr07 (15 to 12) 2 dei5 128 h'00000200 to h'00000203 1 dmac5 hei5 129 h'00000204 to h'00000207 0 to 15 (0) ipr07 (11 to 8) 2 dei6 132 h'00000210 to h'00000213 1 dmac6 hei6 133 h'00000214 to h'00000217 0 to 15 (0) ipr07 (7 to 4) 2 dei7 136 h'00000220 to h'00000223 1 dmac7 hei7 137 h'00000224 to h'00000227 0 to 15 (0) ipr07 (3 to 0) 2 usb usbi 140 h'00000230 to h'00000233 0 to 15 (0) ipr08 (15 to 12) ? cmi0 142 h'00000238 to h'0000023b 0 to 15 (0) ipr08 (7 to 4) ? cmt cmi1 143 h'0000023c to h'0000023f 0 to 15 (0) ipr08 (3 to 0) ? bsc cmi 144 h'00000240 to h'00000243 0 to 15 (0) ipr09 (15 to 12) ? wdt iti 145 h'00000244 to h'00000247 0 to 15 (0) ipr09 (11 to 8) ? low
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 149 of 1262 rej09b0437-0100 interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority hifi 146 h'00000248 to h'0000024b 0 to 15 (0) ipr09 (7 to 4) ? high hif hifbi 150 h'00000258 to h'0000025b 0 to 15 (0) ipr09 (3 to 0) ? adm1i 153 h'00000264 to h'00000267 0 to 15 (0) ipr10 (15 to 12) ? c[0]i 155 h'0000026c to h'0000026f 0 to 15 (0) ipr10 (11 to 8) ? c[1]i 157 h'00000274 to h'00000277 0 to 15 (0) ipr10 (7 to 4) ? a-dmac feci 159 h'0000027c to h'0000027f 0 to 15 (0) ipr11 (7 to 4) ? etc eint0 171 h'000002ac to h'000002af 0 to 15 (0) ipr12 (15 to 12) ? stpi0 172 h'000002b0 to h'000002b3 1 naki0 173 h'000002b4 to h'000002b7 2 rxi0 174 h'000002b8 to h'000002bb 3 txi0 175 h'000002bc to h'000002bf 4 iic3-0 tei0 176 h'000002c0 to h'000002c3 0 to 15 (0) ipr12 (11 to 8) 5 stif sti0 182 h'000002d8 to h'000002db 0 to 15 (0) ipr12 (3 to 0) ? sti1 187 h'000002ec to h'000002ef 0 to 15 (0) ipr13 (15 to 12) ? low
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 150 of 1262 rej09b0437-0100 interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority bri0 192 h'00000300 to h'00000303 1 high eri0 193 h'00000304 to h'00000307 2 rxi0 194 h'00000308 to h'0000030b 3 scif0 txi0 195 h'0000030c to h'0000030f 0 to 15 (0) ipr13 (11 to 8) 4 bri1 196 h'00000310 to h'00000313 1 eri1 197 h'00000314 to h'00000317 2 rxi1 198 h'00000318 to h'0000031b 3 scif1 txi1 199 h'0000031c to h'0000031f 0 to 15 (0) ipr13 (7 to 4) 4 bri2 200 h'00000320 to h'00000323 1 eri2 201 h'00000324 to h'00000327 2 rxi2 202 h'00000328 to h'0000032b 3 scif2 txi2 203 h'0000032c to h'0000032f 0 to 15 (0) ipr13 (3 to 0) 4 ssi0 ssii0 214 h'00000358 to h'0000035b 0 to 15 (0) ipr14 (3 to 0) ? ssi1 ssii1 215 h'0000035c to h'0000035f 0 to 15 (0) ipr15 (15 to 12) ? sdii3 228 h'00000390 to h'00000393 1 sdii0 229 h'00000394 to h'00000397 2 sdio sdii1 230 h'00000398 to h'0000039b 0 to 15 (0) ipr16 (11 to 8) 3 low
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 151 of 1262 rej09b0437-0100 6.6 operation 6.6.1 interrupt op eration sequence the sequence of interrupt operations is described below. figure 6.2 shows the operation flow. 1. the interrupt request sources send interrupt request signals to the interrupt controller. 2. the interrupt controller selects the highest-prio rity interrupt from the interrupt requests sent, following the priority levels set in interrupt pr iority registers 01, 02, and 06 to 16 (ipr01, ipr02, and ipr06 to ipr16). lower priority interr upts are ignored*. if tw o of these interrupts have the same priority level or if multiple interrupts occur within a single ipr, the interrupt with the highest priority is selected, according to the default priority and ipr setting unit internal priority shown in table 6.4. 3. the priority level of the interrupt selected by the interrupt controller is compared with the interrupt level mask bits (i3 to i0) in the stat us register (sr) of the cpu. if the interrupt request priority level is equal to or less than the le vel set in bits i3 to i0, the interrupt request is ignored. if the interrupt request priority level is higher than the level in bits i3 to i0, the interrupt controller accepts the interrupt and send s an interrupt request signal to the cpu. 5. the cpu detects the interrupt request sent fro m the interrupt controller when the cpu decodes the instruction to be executed. instead of executing the decode d instruction, the cpu starts interrupt exception handling (figure 6.4). 6. the interrupt exception service routine start address is fetched from the exception handling vector table corresponding to the accepted interrupt. 7. the status register (sr) is saved onto the stac k, and the priority level of the accepted interrupt is copied to bits i3 to i0 in sr. 8. the program counter (pc) is saved onto the stack. 9. the cpu jumps to the fetched interrupt exce ption service routine st art address and starts executing the program. the jump that occurs is not a delayed branch. 10. a high level is output from the irqout pin. however, if the inte rrupt controller accepts an interrupt with a higher pr iority than the interrup t just being accepted, the irqout pin holds low level.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 152 of 1262 rej09b0437-0100 notes: the interrupt sour ce flag should be cleared in the in terrupt handler. after clearing the interrupt source flag, "time from occurrence of interrupt request until interrupt controller identifies priority, compares it with mask bits in sr, and sends interrupt request signal to cpu" shown in table 6.5 is required before the interrupt source sent to the cpu is actually cancelled. to ensure that an interrupt requ est that should have been cleared is not inadvertently accepted again, read the interr upt source flag after it has been cleared, and then execute an rte instruction. * interrupt requests that are designated as edge-sensing are held pending until the interrupt requests are accepted. irq interrupt s, however, can be cancelled by accessing the irq interrupt request register (irqrr) . for details, see section 6.4.4, irq interrupts. interrupts held pending due to edge-sensing are cleared by a power-on reset.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 153 of 1262 rej09b0437-0100 no no no no yes yes yes yes yes yes no yes no yes yes no no no no program execution state interrupt? nmi? user break? i3 to i0 level 14? level 14 interrupt? level 1 interrupt? i3 to i0 level 13? i3 to i0 = level 0? h-udi interrupt? level 15 interrupt? irqout = low save sr to stack save pc to stack copy accept-interrupt level to i3 to i0 irqout = high read exception handling vector table branch to interrupt exception service routine figure 6.2 interru pt operation flow
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 154 of 1262 rej09b0437-0100 6.6.2 stack after interru pt exception handling figure 6.3 shows the stack after interrupt exception handling. address sp * 2 4n ? 8 pc * 1 sr 4n ? 4 4n 32 bits 32 bits notes: 1. pc: start address of the next instruction (return destination instruction) after the executed instruction 2. always make sure that sp is a multiple of 4. figure 6.3 stack after interrupt exception handling
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 155 of 1262 rej09b0437-0100 6.7 interrupt response time table 6.5 lists the interrupt response time, which is the time from the occurrence of an interrupt request until the interrupt exception handling starts and fetching of the first instruction in the exception service routine begins. the interrupt pro cessing operations diff er in the cases when banking is disabled, when banking is enabled without register bank overflow, and when banking is enabled with register bank overflow. figures 6.4 and 6.5 show examples of pipeline operation when banking is disabled. figures 6.6 and 6.7 show examples of pipeline operation when banking is enabled without register bank overflow. figures 6.8 and 6.9 show examples of pipeline operation when banking is enabled with register bank overflow. table 6.5 interrupt response time number of states item nmi user break h-udi irq, pint peripheral module remarks time from occurrence of interrupt request until interrupt controller identifies priority, compares it with mask bits in sr, and sends interrupt request signal to cpu 2 icyc + 2 bcyc + 1 pcyc 3 icyc 2 icyc + 1 pcyc 2 icyc + 3 bcyc + 1 pcyc 2 icyc + 1 bcyc + 1 pcyc min. 3 icyc + m1 + m2 no register banking max. 4 icyc + 2 (m1 + m2) + m3 min. is when the interrupt wait time is zero. max. is when a higher-priority interrupt request has occurred during interrupt exception handling. min. ? 3 icyc + m1 + m2 register banking without register bank overflow max. ? 12 icyc + m1 + m2 min. is when the interrupt wait time is zero. max. is when an interrupt request has occurred during execution of the resbank instruction. min. ? 3 icyc + m1 + m2 time from input of interrupt request signal to cpu until sequence currently being executed is completed, interrupt exception handling starts, and first instruction in interrupt exception service routine is fetched register banking with register bank overflow max. ? 3 icyc + m1 + m2 + 19(m4) min. is when the interrupt wait time is zero. max. is when an interrupt request has occurred during execution of the resbank instruction.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 156 of 1262 rej09b0437-0100 number of states item nmi user break h-udi irq, pint peripheral module remarks min. 5 icyc + 2 bcyc + 1 pcyc + m1 + m2 6 icyc + m1 + m2 5 icyc + 1 pcyc + m1 + m2 5 icyc + 3 bcyc + 1 pcyc + m1 + m2 5 icyc + 1 bcyc + 1 pcyc + m1 + m2 200-mhz operation * 1 * 2 : 0.040 to 0.110 s no register banking max. 6 icyc + 2 bcyc + 1 pcyc + 2(m1 + m2) + m3 7 icyc + 2(m1 + m2) + m3 6 icyc + 1 pcyc + 2(m1 + m2) + m3 6 icyc + 3 bcyc + 1 pcyc + 2(m1 + m2) + m3 6 icyc + 1 bcyc + 1 pcyc + 2(m1 + m2) + m3 200-mhz operation * 1 * 2 : 0.060 to 0.130 s min. ? ? 5 icyc + 1 pcyc + m1 + m2 5 icyc + 3 bcyc + 1 pcyc + m1 + m2 5 icyc + 1 bcyc + 1 pcyc + m1 + m2 200-mhz operation * 1 * 2 : 0.040 to 0.110 s register banking without register bank overflow max. ? ? 14 icyc + 1 pcyc + m1 + m2 14 icyc + 3 bcyc + 1 pcyc + m1 + m2 14 icyc + 1 bcyc + 1 pcyc + m1 + m2 200-mhz operation * 1 * 2 : 0.085 to 0.155 s min. ? ? 5 icyc + 1 pcyc + m1 + m2 5 icyc + 3 bcyc + 1 pcyc + m1 + m2 5 icyc + 1 bcyc + 1 pcyc + m1 + m2 200-mhz operation * 1 * 2 : 0.040 to 0.110 s interrupt response time register banking with register bank overflow max. ? ? 5 icyc + 1 pcyc + m1 + m2 + 19(m4) 5 icyc + 3 bcyc + 1 pcyc + m1 + m2 + 19(m4) 5 icyc + 1 bcyc + 1 pcyc + m1 + m2 + 19(m4) 200-mhz operation * 1 * 2 : 0.135 to 0.205 s notes: m1 to m4 are the number of stat es needed for the following memory accesses. m1: vector address read (longword read) m2: sr save (longword write) m3: pc save (longword write) m4: banked registers (r0 to r14, gbr, mach, macl, and pr) are restored from the stack. 1. in the case that m1 = m2 = m3 = m4 = 1 icyc. 2. in the case that (i , b , p ) = (200 mhz, 66 mhz, 33 mhz).
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 157 of 1262 rej09b0437-0100 f 2 icyc + 3 bcyc + 1 pcyc 3 icyc m1 m2 m3 3 icyc + m1 + m2 irq instruction (instruction replacing interrupt exception handling) m1: m2: m3: f: d: e: m: first instruction in interrupt exception service routine interrupt acceptance deemm m fd e [legend] vector address read saving of sr (stack) saving of pc (stack) instruction fetch. instruction is fetched from memory in which program is stored. instruction decoding. fetched instruction is decoded. instruction execution. data operation or address calculation is performed in accordance with the result of decoding. memory access. memory data access is performed. figure 6.4 example of pipeline operati on when irq interrupt is accepted (no register banking)
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 158 of 1262 rej09b0437-0100 f 2 icyc + 3 bcyc + 1 pcyc 1 icyc + m1 + 2(m2) + m3 m1 m2 m3 3 icyc + m1 irq deemm m deemm m f d f d m1 m2 [legend] m1: m2: m3: vector address read saving of sr (stack) saving of pc (stack) interrupt acceptance multiple interrupt acceptance first instruction in interrupt exception service routine first instruction in multiple interrupt exception service routine figure 6.5 example of pipeline op eration for multiple interrupts (no register banking) f 2 icyc + 3 bcyc + 1 pcyc 3 icyc m1 m2 m3 3 icyc + m1 + m2 irq d e emmm e fd e [legend] m1: m2: m3: vector address read saving of sr (stack) saving of pc (stack) interrupt acceptance first instruction in interrupt exception service routine instruction (instruction replacing interrupt exception handling) figure 6.6 example of pipeline operati on when irq interrupt is accepted (register banking without register bank overflow)
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 159 of 1262 rej09b0437-0100 f 2 icyc + 3 bcyc + 1 pcyc 3 icyc + m1 + m2 m1 m2 m3 9 icyc irq resbank instruction deeeeeeee e deemmm e f d [legend] m1: m2: m3: vector address read saving of sr (stack) saving of pc (stack) interrupt acceptance first instruction in interrupt exception service routine instruction (instruction replacing interrupt exception handling) figure 6.7 example of pipeline operation when interrupt is accepted during resbank instruction execution (register banki ng without register bank overflow) f 2 icyc + 3 bcyc + 1 pcyc 3 icyc m1 m2 m3 3 icyc + m1 + m2 irq deem m m m f d [legend] m1: m2: m3: vector address read saving of sr (stack) saving of pc (stack) interrupt acceptance first instruction in interrupt exception service routine instruction (instruction replacing interrupt exception handling) ... ... ... figure 6.8 example of pipeline operati on when irq interrupt is accepted (register banking with register bank overflow)
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 160 of 1262 rej09b0437-0100 f 2 icyc + 3 bcyc + 1 pcyc 1 icyc + m1 + m2 + 2(m4) m1 m2 m3 2 icyc + 17(m4) irq resbank instruction d emmm mmm w deemm m f d m4 m4 [legend] m1: m2: m3: m4: vector address read saving of sr (stack) saving of pc (stack) restoration of banked registers interrupt acceptance first instruction in interrupt exception service routine instruction (instruction replacing interrupt exception handling) ... ... ... figure 6.9 example of pipeline operation when interrupt is accepted during resbank instruction execution (register banki ng with register bank overflow)
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 161 of 1262 rej09b0437-0100 6.8 register banks this lsi has fifteen register banks used to perform register saving and restoration required in the interrupt processing at high speed. figure 6.10 shows the register bank configuration. general registers bank control register bank number register bank control registers (interrupt controller) banked register vector table address offset note: interrupt generated (save) resbank instruction (restore) registers register banks bank 0 bank 1 .... bank 14 r0 r1 : : r14 r15 sr gbr vbr tbr mach macl pr pc control registers system registers r0 r1 : : r14 gbr vto vto: ibcr ibnr mach macl pr : figure 6.10 overview of register bank configuration
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 162 of 1262 rej09b0437-0100 6.8.1 banked register and input/output of banks (1) banked register the contents of the general registers (r0 to r14), global base register (gbr), multiply and accumulate registers (mach and macl), and pro cedure register (pr), and the vector table address offset are banked. (2) input/output of banks this lsi has fifteen register banks, bank 0 to bank 14. register banks are stacked in first-in last- out (filo) sequence. saving takes place in order, beginning from bank 0, and restoration takes place in the reverse order, beginning from the last bank saved to. 6.8.2 bank save and restore operations (1) saving to bank figure 6.11 shows register bank save operations. the following operations are performed when an interrupt for which usage of register banks is allowed is accepted by the cpu: a. assume that the bank number bit value in the bank number register (ibnr), bn, is i before the interrupt is generated. b. the contents of registers r0 to r14, gbr, mach, macl, and pr, and the interrupt vector table address offset (v to) of the accepted interrupt are save d in the bank indicated by bn, bank i. c. the bn value is incremented by 1. bank 0 register banks registers bank 1 : : : : bank i bank i + 1 bank 14 +1 (a) (c) (b) bn gbr mach macl pr vto r0 to r14 figure 6.11 bank save operations
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 163 of 1262 rej09b0437-0100 figure 6.12 shows the timing for sa ving to a register bank. saving to a register bank takes place between the start of interrupt exception handling and th e start of fetching the first instruction in the interrupt exception service routine. f 2 icyc + 3 bcyc + 1 pcyc 3 icyc m1 m2 m3 3 icyc + m1 + m2 irq (1) vto, pr, gbr, macl (2) r12, r13, r14, mach (3) r8, r9, r10, r11 (4) r4, r5, r6, r7 (5) r0, r1, r2, r3 overrun fetch saved to bank d e emmm e f fd e [legend] m1: m2: m3: vector address read saving of sr (stack) saving of pc (stack) first instruction in interrupt exception service routine instruction (instruction replacing interrupt exception handling) figure 6.12 bank save timing (2) restoration from bank the resbank (restore from register bank) instruction is used to restore data saved in a register bank. after restoring data from the register banks with the resbank instruction at the end of the interrupt exception service routine, execute the rt e instruction to return from interrupt exception service routine.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 164 of 1262 rej09b0437-0100 6.8.3 save and restore operations after saving to all banks if an interrupt occurs and usage of the register banks is enabled for the interrupt accepted by the cpu in a state where saving has been performed to all register banks, automatic saving to the stack is performed instead of register bank saving if the bove bit in the bank number register (ibnr) is cleared to 0. if the bove bit in ibnr is set to 1, register bank overflow exception occurs and data is not saved to the stack. save and restore operations when using the stack are as follows: (1) saving to stack 1. the status register (sr) and program counter (pc) are saved to the stack during interrupt exception handling. 2. the contents of the banked registers (r0 to r14, gbr, mach, macl, and pr) are saved to the stack. the registers are saved to the stack in the order of macl, mach, gbr, pr, r14, r13, ?, r1, and r0. 3. the register bank overflow bit (bo) in sr is set to 1. 4. the bank number bit (bn) value in the ba nk number register (ibnr) remains set to the maximum value of 15. (2) restoration from stack when the resbank (restore from register bank) instruction is executed with the register bank overflow bit (bo) in sr set to 1, the cpu operates as follows: 1. the contents of the banked registers (r0 to r14, gbr, mach, macl , and pr) are restored from the stack. the registers are restored from the stack in the order of r0, r1, ?, r13, r14, pr, gbr, mach, and macl. 2. the bank number bit (bn) value in the ba nk number register (ibnr) remains set to the maximum value of 15.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 165 of 1262 rej09b0437-0100 6.8.4 register bank exception there are two register bank exceptions (register bank errors): register bank overflow and register bank underflow. (1) register bank overflow this exception occurs if, after data has been saved to all of the register banks, an interrupt for which register bank use is allowed is accepted by the cpu, and the bove bit in the bank number register (ibnr) is set to 1. in this case, the bank number bit (bn) value in the bank number register (ibnr) remains set to the bank count of 15 and saving is not performed to the register bank. (2) register bank underflow this exception occurs if the resb ank (restore from register bank ) instruction is executed when no data has been saved to the register banks. in this case, the values of r0 to r14, gbr, mach, macl, and pr do not change. in addition, the bank number bit (bn) value in the bank number register (ibnr) remains set to 0. 6.8.5 register bank e rror exception handling when a register bank error occurs, register bank error exception handling starts. when this happens, the cpu operates as follows: 1. the exception service routine start address which corresponds to the register bank error that occurred is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the last execut ed instruction for a regi ster bank overflow, and the start address of the execut ed resbank instruction for a register bank underflow. to prevent multiple interrupts from occurring at a register bank overflow, the interrupt priority level that caused the register bank overflow is written to the interrupt mask level bits (i3 to i0) of the status register (sr). 4. program execution starts from the exception service routine start address.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 166 of 1262 rej09b0437-0100 6.9 data transfer with interrupt request signals interrupt request signals can be used to activate the dmac and transfer data. interrupt sources that are designated to activate the dmac are masked without being input to the intc. the mask condition is as follows: mask condition = dme ? (de0 ? interrupt source select 0 + de1 ? interrupt source select 1 + de2 ? interrupt source select 2 + de3 ? interrupt source select 3 + de4 ? interrupt source select 4 + de5 ? interrupt source select 5 + de6 ? interrupt source select 6 + de7 ? interrupt source select 7) figure 6.13 shows a block diagram of interrupt control. here, dme is bit 0 in dmaor of the dmac, and den (n = 0 to 7) is bit 0 in chcr0 to chcr7 of the dmac. for details, see section 8, direct memory access controller (dmac). dmac intc cpu cpu interrupt request interrupt source interrupt source (not specified as dmac activating source) interrupt source flag clearing (by dmac) figure 6.13 interrupt control block diagram
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 167 of 1262 rej09b0437-0100 6.9.1 handling interrupt reque st signals as sources for cpu interrupt but not dmac activating 1 do not select dmac activating sources or clear the dme bit to 0. if, dmac activating sources are selected, clear th e de bit to 0 for the relevant channel of the dmac. 2. when interrupts occur, interrupt requests are sent to the cpu. 3. the cpu clears the interrupt source and perfor ms the necessary proce ssing in the interrupt exception service routine. 6.9.2 handling interrupt reque st signals as sources for activating dm ac but not cpu interrupt 1. select dmac activating sources and set both the de and dme bits to 1. this masks cpu interrupt sources regardless of the in terrupt priority register settings. 2. activating sources are applied to the dmac when in terrupts occur. 3. the dmac clears the interrupt sources when st arting transfer.
section 6 interrupt controller (intc) rev. 1.00 nov. 14, 2007 page 168 of 1262 rej09b0437-0100 6.10 usage note 6.10.1 timing to clear an interrupt source the interrupt source flags should be cleared in the interrupt exception service routine. after clearing the interrupt source flag, "time from occurrence of interrupt request until interrupt controller identifies priority, compares it with ma sk bits in sr, and sends interrupt request signal to cpu" shown in table 6.5 is required before the interrupt source sent to the cpu is actually cancelled. to ensure that an interrupt request that should have been cleared is not inadvertently accepted again, read the interrupt source flag afte r it has been cleared, and then execute an rte instruction.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 169 of 1262 rej09b0437-0100 section 7 bus state controller (bsc) the bus state controller (bsc) outputs control sign als for various types of memory and external devices that are connected to the external address space. bsc functi ons enable this lsi to connect directly with sram, sdram, and other memory storage devices, and external devices. 7.1 features 1. external address space ? a maximum of 64 mbytes for each of areas cs0 and cs3 to cs6. ? can specify the normal space interface, sram interface with byte se lection, sdram, and pcmcia interface for each address space. ? can select the data bus width (8, 16 , or 32 bits) for each address space. ? controls insertion of wait cycles for each address space. ? controls insertion of wait cycles for each read access and write access. ? can set independent idle cycles during the c ontinuous access for five cases: read-write (in same space/different spaces), read-read (in same space/different spaces), the first cycle is a write access. 2. normal space interface ? supports the interface that can directly connect to the sram. 3. sdram interface ? can set the sdram in up to two areas. ? multiplex output for row address/column address. ? efficient access by single read/single write. ? high-speed access in bank-active mode. ? supports an auto-refresh and self-refresh. ? supports power-down modes. ? issues mrs and emrs commands. 4. pcmcia direct interface ? supports the ic memory card and i/o card in terface defined in jeid a specifications ver. 4.2 (pcmcia2.1 rev. 2.1). ? wait-cycle insertion cont rollable by program. 5. sram interface with byte selection ? can connect directly to a sram with byte selection.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 170 of 1262 rej09b0437-0100 6. refresh function ? supports the auto-refresh and self-refresh functions. ? specifies the refresh interval using th e refresh counter an d clock selection. ? can execute concentrated refresh by specifying the refresh counts (1, 2, 4, 6, or 8). 7. usage as interval timer for refresh counter ? generates an interrupt request at compare match.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 171 of 1262 rej09b0437-0100 figure 7.1 shows a block diagram of the bsc. cmncr cs0wcr cs7wcr cs0bcr cs7bcr sdcr rtcsr rtcnt rtcor comparator bus mastership controller wait controller area controller internal bus memory controller refresh controller [legend] module bus bsc cs0 to cs7 refout wait md a25 to a0, d31 to d0 back breq bs , rd/ wr , rd , we3 to we0 , rasu , rasl , casu , casl cke, dqmxx, ah , frame , iois16 , ce2a , ce2b cmncr: csnwcr: csnbcr: sdcr: rtcsr: rtcnt: rtcor: common control register csn space wait control register (n = 0 to 7) csn space bus control register (n = 0 to 7) sdram control register refresh timer control/status register refresh timer counter refresh time constant register . . . . . . . . . . . . . . . figure 7.1 block diagram of bsc
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 172 of 1262 rej09b0437-0100 7.2 input/output pins table 7.1 shows the pin configuration of the bsc. table 7.1 pin configuration name i/o function a25 to a0 output address bus d31 to d0 i/o data bus bs output bus cycle start cs0 , cs3 , cs4 output chip select cs5 / ce1a , cs6 / ce1b output chip select function as pcmcia card select si gnals for d7 to d0 when pcmcia is used. ce2a , ce2b output function as pcmcia card select signals for d15 to d8. rd/ wr output read/write connects to we pins when sdram or sram with byte selection is connected. rd output read pulse signal (read data output enable signal) functions as a strobe signal for indicating memory read cycles when pcmcia is used. we3 /dqmuu/ iciowr output indicates that d31 to d24 are being written to. connected to the byte select signal when a sram with byte selection is connected. functions as the select signals for d31 to d24 when sdram is connected. functions as a strobe signal fo r indicating i/o write cycles when pcmcia is used. we2 /dqmul/ iciord output indicates that d23 to d16 are being written to. connected to the byte select signal when a sram with byte selection is connected. functions as the select signals for d23 to d16 when sdram is connected. functions as a strobe signal for indicating i/o read cycles when pcmcia is used.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 173 of 1262 rej09b0437-0100 name i/o function we1 /dqmlu/ we output indicates that d15 to d8 are being written to. connected to the byte select signal when a sram with byte selection is connected. functions as the select signals for d15 to d8 when sdram is connected. functions as a strobe signal for indicating memory write cycles when pcmcia is used. we0 /dqmll output indicates that d7 to d0 are being written to. connected to the byte select signal when a sram with byte selection is connected. functions as the select signals for d7 to d0 when sdram is connected. ras output connects to ras pin when sdram is connected. cas output connects to cas pin when sdram is connected. cke output connects to cke pin when sdram is connected. wait input external wait input iois16 input indicates 16-bit i/o of pcmia. enabled only in little endian mode. the pin should be driven low in big endian mode. md_bw input selects bus width of area 0 a nd initial bus width of areas 3 to 6.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 174 of 1262 rej09b0437-0100 7.3 area overview 7.3.1 address map in the architecture, this lsi has a 32-bit address space, which is divided into cache-enabled, cache-disabled, and on-chip spaces (on-chip ram, on-chip peri pheral modules, and reserved areas) according to the upper bits of the address. external address spaces cs0, cs3 to cs6 are cach e-enabled when internal address a29 = 0 or cache-disabled when a29 = 1. the kind of memory to be connected and the da ta bus width are specified in each partial space. the address map for the external address space is listed below. table 7.2 address map internal address space memory to be connected cache h'00000000 to h'03ffffff cs0 normal space, sram with byte selection h'04000000 to h'07ffffff other reserved area h'08000000 to h'0bffffff other reserved area h'0c000000 to h'0fffffff cs3 normal space, sram with byte selection, sdram h'10000000 to h'13ffffff cs4 normal space, sram with byte selection h'14000000 to h'17ffffff cs5 normal space, sram with byte selection, pcmcia h'18000000 to h'1bffffff cs6 normal space, sram with byte selection, pcmcia h'1c000000 to h'1fffffff other reserved area cache-enabled h'20000000 to h'23ffffff cs0 normal space, sram with byte selection, burst rom (asynchronous or synchronous) h'24000000 to h'27ffffff other reserved area h'28000000 to h'2bffffff other reserved area h'2c000000 to h'2fffffff cs3 normal space, sram with byte selection, sdram h'30000000 to h'33ffffff cs4 normal space, sram with byte selection h'34000000 to h'37ffffff cs5 normal space, sram with byte selection, pcmcia h'38000000 to h'3bffffff cs6 normal space, sram with byte selection, pcmcia h'3c000000 to h'3fffffff other reserved area cache-disabled
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 175 of 1262 rej09b0437-0100 internal address space memory to be connected cache h'80000000 to h'fffbffff other on-chip ram, reserved area * ? h'fffc0000 to h'ffffffff other on-chi p peripheral modules, reserved area * ? note: * for the on-chip ram space, access the addresses shown in section 27, on-chip ram. for the on-chip peripheral module space, access the addresses shown in section 28, list of registers. do not access addresses which are not described in these sections. otherwise, the correct operat ion cannot be guaranteed. 7.3.2 data bus width and pin function setting in each area in this lsi, the data bus width of area 0 and the initial data bus width of areas 3 to 6 can be set to 8, or 16 bits through external pins during a power-on reset. the bus width of area 0 cannot be modified after a power-on reset. the initial data bus width of areas 3 to 6 is set to the same size as that of area 0, but can be modified to 8, 16, or 32 bits through register settings during program execution. note that the selectable data bus widths may be limited depending on the connected memory type. after a power-on reset, the lsi starts execution of the program stored in the external memory allocated in area 0. since rom is assumed as the external memory in area 0, minimum pin functions such as the address bus, data bus, cs0 , and rd are available. the sample access waveforms shown in this section include other pins such as bs , rd/ wr , and wen , which are available after they are selected through the pin function controller. do not attempt any form of memory access other than reading of area 0 until the pin function settings ha ve been completed by the program. for details on pin function settings, see section 23, pin function controller (pfc). table 7.3 correspondence be tween external pin (md) and data bus width md_bw data bus width 1 8 bits 0 16 bits
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 176 of 1262 rej09b0437-0100 7.4 register descriptions the bsc has the following registers. do not access spaces other than area 0 until setti ngs of the connected memory interface are completed. table 7.4 register configuration register name abbreviation r/w initial value address access size common control register cmncr r/w h'00001010 h'fffc0000 32 cs0 space bus control register cs0bcr r/w h'36db0200 * 3 h'fffc0004 32 cs3 space bus control register cs3bcr r/w h'36db0200 * 3 h'fffc0010 32 cs4 space bus control register cs4bcr r/w h'36db0200 * 3 h'fffc0014 32 cs5 space bus control register cs5bcr r/w h'36db0200 * 3 h'fffc0018 32 cs6 space bus control register cs6bcr r/w h'36db0200 * 3 h'fffc001c 32 cs0 space wait control register cs0wcr r/w h'00000500 h'fffc0028 32 cs3 space wait control register cs3wcr r/w h'00000500 h'fffc0034 32 cs4 space wait control register cs4wcr r/w h'00000500 h'fffc0038 32 cs5 space wait control register cs5wcr r/w h'00000500 h'fffc003c 32 cs6 space wait control register cs6wcr r/w h'00000500 h'fffc0040 32 sdram control register sdcr r/w h'00000000 h'fffc004c 32 refresh timer control/status register rtcsr r/w h'00000000 h'fffc0050 32 refresh timer counter rtcnt r/w h'00000000 h'fffc0054 32 refresh time constant register rtcor r/w h'00000000 h'fffc0058 32 ac characteristics switching register acswr r/w * 1 h'00000000 h'fffc180c 32 internal bus master bus priority register ibmpr r/w h'12300000 h'fffc1818 32 ac characteristics switching key register ackyer w * 2 ? h'fffc1bfc 8 notes: 1. to write to this register, a special sequence using key registers for switching the ac characteristics is required. 2. write-only register. the write value is arbitrary. 3. this is an initial value when this lsi is started by the external pin (md_bw) with the bus width set to 8 bits. the initial value will be h'36db0400 when the bus width is set to 16 bits.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 177 of 1262 rej09b0437-0100 7.4.1 common control register (cmncr) cmncr is a 32-bit register that contro ls the common items for each area. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 151413121110987654321 0 0000000000000000 rrrrrrrrrrrrrrrr 0001000000010000 rrrrrrrr/wr/wr/wr/wrrrr/wr/w ??????? ??? ????????? ???? dmaiw[2:0] dma iwa ??? hiz mem hiz cnt bit bit name initial value r/w description 31 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 to 6 dmaiw[2:0] 000 r/w wait states between access cycles when dma single address transfer is performed. specify the number of idle cycles to be inserted after an access to an external device with dack when dma single address transfer is performed. the method of inserting idle cycles depends on the contents of dmaiwa. 000: no idle cycle inserted 001: 1 idle cycle inserted 010: 2 idle cycles inserted 011: 4 idle cycles inserted 100: 6 idle cycles inserted 101: 8 idle cycles inserted 110: 10 idle cycles inserted 111: 12 idle cycles inserted
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 178 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 dmaiwa 0 r/w method of inserting wait states between access cycles when dma single address transfer is performed. specifies the method of in serting the idle cycles specified by the dmaiw[2:0] bit. clearing this bit will make this lsi insert the idle cycles when another device, which includes this lsi, drives the data bus after an external device with dack drove it. however, when the external device with dack drives the data bus continuously, idle cycles are not inserted. setting this bit will make this lsi in sert the idle cycles after an access to an external device with dack, even when the continuous access cycles to an external device with dack are performed. 0: idle cycles inserted when another device drives the data bus after an external device with dack drove it. 1: idle cycles always inserted after an access to an external device with dack 4 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 hizmem 0 r/w high-z memory control specifies the pin state in software standby mode for a25 to a0, bs , csn , ce2x , rd/ wr , wen /dqmxx, and rd . at bus-released state, these pin are high- impedance states regardless of the setting value of the hizmem bit. 0: high impedance in software standby mode 1: driven in software standby mode
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 179 of 1262 rej09b0437-0100 bit bit name initial value r/w description 0 hizcnt * 0 r/w high-z control specifies the state of cke, ras , and cas in software standby mode. 0: high impedance in software standby mode 1: driven in software standby mode note: * for high-z control of ckio, see sect ion 9, clock pulse generator (cpg). 7.4.2 csn space bus control register (csnbcr) (n = 0, 3 to 6) csnbcr is a 32-bit readable/writabl e register that specifies the fu nction of each area, the number of idle cycles between bus cycles, and the bus width. do not access external memory other than area 0 until csnbcr initial setting is completed. idle cycles may be inserted even when they are not specified. for details, see section 7.5.8, wait between access cycles. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0011011011011011 r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 000001 * 1 * 000000000 r r/w r/w r/w r/w r/w r/w r r r r r r r r r bit: initial value: r/w: bit: initial value: r/w: note: csnbcr samples the external pin (md) that specify the bus width at power-on reset. * - iww[2:0] iwrwd[2:0] iwrws[2:0] iwrrd[2:0] iwrrs[2:0] - type[2:0] endian bsz[1:0] - - - - - - - - - bit bit name initial value r/w description 31 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 180 of 1262 rej09b0437-0100 bit bit name initial value r/w description 30 to 28 iww[2:0] 011 r/w idle cycles between write-read cycles and write- write cycles these bits specify the number of idle cycles to be inserted after the access to a memory that is connected to the space. t he target access cycles are the write-read cycle an d write-write cycle. 000: no idle cycle inserted 001: 1 idle cycle inserted 010: 2 idle cycles inserted 011: 4 idle cycles inserted 100: 6 idle cycles inserted 101: 8 idle cycles inserted 110: 10 idle cycles inserted 111: 12 idle cycles inserted 27 to 25 iwrwd[2:0] 011 r/w idle c ycles for another space read-write specify the number of idle cycles to be inserted after the access to a memory that is connected to the space. the target access cycle is a read-write one in which continuous access cycles switch between different spaces. 000: no idle cycle inserted 001: 1 idle cycle inserted 010: 2 idle cycles inserted 011: 4 idle cycles inserted 100: 6 idle cycles inserted 101: 8 idle cycles inserted 110: 10 idle cycles inserted 111: 12 idle cycles inserted
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 181 of 1262 rej09b0437-0100 bit bit name initial value r/w description 24 to 22 iwrws[2:0] 011 r/w idle cycles for read-write in the same space specify the number of idle cycles to be inserted after the access to a memory that is connected to the space. the target cycle is a read-write cycle of which continuous access cycles are for the same space. 000: no idle cycle inserted 001: 1 idle cycle inserted 010: 2 idle cycles inserted 011: 4 idle cycles inserted 100: 6 idle cycles inserted 101: 8 idle cycles inserted 110: 10 idle cycles inserted 111: 12 idle cycles inserted 21 to 19 iwrrd[2:0] 011 r/w idle cycl es for read-read in another space specify the number of idle cycles to be inserted after the access to a memory that is connected to the space. the target cycle is a read-read cycle of which continuous access cycles switch between different space. 000: no idle cycle inserted 001: 1 idle cycle inserted 010: 2 idle cycles inserted 011: 4 idle cycles inserted 100: 6 idle cycles inserted 101: 8 idle cycles inserted 110: 10 idle cycles inserted 111: 12 idle cycles inserted
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 182 of 1262 rej09b0437-0100 bit bit name initial value r/w description 18 to 16 iwrrs[2:0] 011 r/w idle cycles for read-read in the same space specify the number of idle cycles to be inserted after the access to a memory that is connected to the space. the target cycle is a read-read cycle of which continuous access cycles are for the same space. 000: no idle cycle inserted 001: 1 idle cycle inserted 010: 2 idle cycles inserted 011: 4 idle cycles inserted 100: 6 idle cycles inserted 101: 8 idle cycles inserted 110: 10 idle cycles inserted 111: 12 idle cycles inserted 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 to 12 type[2:0] 000 r/w s pecify the type of memory connected to a space. 000: normal space 001: setting prohibited 010: setting prohibited 011: sram with byte selection 100: sdram 101: pcmcia 110: setting prohibited 111: setting prohibited for details for memory type in each area, see table 7.2. 11 endian 0 r/w endian setting specifies the arrangement of data in a space. 0: arranged in big endian 1: arranged in little endian
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 183 of 1262 rej09b0437-0100 bit bit name initial value r/w description 10, 9 bsz[1:0] 11 * r/w data bus width specification specify the data bus widths of spaces. 00: reserved (setting prohibited) 01: 8-bit size 10: 16-bit size 11: 32-bit size for mpx-i/o, selects bus width by address notes: 1. the initial data bus width for areas 3 to 6 is specified by external pins. the bsz[1:0] bits settings in cs0bcr are ignored but the bus width settings in cs1bcr to cs7bcr can be modified. 2. if area 5 or area 6 is specified as pcmcia space, the bus width can be specified as either 8 bits or 16 bits. 3. if area 3 is specified as sdram space, the bus width can be specified as either 16 bits or 32 bits. 8 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. note: * csnbcr samples the external pins (md_bw) that specify the bus width at power-on reset.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 184 of 1262 rej09b0437-0100 7.4.3 csn space wait control register (csnwcr) (n = 0, 3 to 6) csnwcr specifies various wait cycl es for memory access. the bit co nfiguration of this register varies as shown below according to the memory type (type2 to type0) specified by the csn space bus control register (csn bcr). specify csnwcr before accessi ng the target area. specify csnbcr first, then specify csnwcr. (1) normal space, sram with byte selection ? cs0wcr 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r r r r r r r r/w r/w r r r/w r/w 0000010100000000 r r r r/w r/w r/w r/w r/w r/w r/w r r r r r/w r/w bit: initial value: r/w: bit: initial value: r/w: -----------bas---- - - - sw[1:0] wr[3:0] wm - - - - hw[1:0] bit bit name initial value r/w description 31 to 22 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 21 ? 0 r/w reserved these bits are always read as 0. the write value should always be 0. 20 bas 0 r/w byte access sele ction when sram with byte selection is used specifies the wen and rd/ wr signal timing when the sram interface with byte selection is used. 0: asserts the wen signal at the read/write timing and asserts the rd/ wr signal during the write access cycle. 1: asserts the wen signal during the read/write access cycle and asserts the rd/ wr signal at the write timing.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 185 of 1262 rej09b0437-0100 bit bit name initial value r/w description 19, 18 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 17, 16 ? all 0 r/w reserved set this bit to 0 when the interface for normal space or sram with byte selection is used. 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12, 11 sw[1:0] 00 r/w number of delay cycles from address, cs0 assertion to rd , wen assertion specify the number of delay cycles from address and cs0 assertion to rd and wen assertion. 00: 0.5 cycles 01: 1.5 cycles 10: 2.5 cycles 11: 3.5 cycles
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 186 of 1262 rej09b0437-0100 bit bit name initial value r/w description 10 to 7 wr[3:0] 1010 r/w number of access wait cycles specify the number of cycles that are necessary for read/write access. 0000: no cycle 0001: 1 cycle 0010: 2 cycles 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles 0110: 6 cycles 0111: 8 cycles 1000: 10 cycles 1001: 12 cycles 1010: 14 cycles 1011: 18 cycles 1100: 24 cycles 1101: reserved (setting prohibited) 1110: reserved (setting prohibited) 1111: reserved (setting prohibited) 6 wm 0 r/w external wait mask specification specifies whether or not the external wait input is valid. the specification by this bit is valid even when the number of access wait cycle is 0. 0: external wait input is valid 1: external wait input is ignored 5 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 187 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1, 0 hw[1:0] 00 r/w delay cycles from rd, wen negation to address, cs0 negation specify the number of delay cycles from rd and wen negation to address and cs0 negation. 00: 0.5 cycles 01: 1.5 cycles 10: 2.5 cycles 11: 3.5 cycles ? cs3wcr 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrr/wrrrr 0000010100000000 r r r r r r/w r/w r/w r/w r/w r r r r r r ??????????? bas ???? ????? wr[3:0] wm ?????? bit bit name initial value r/w description 31 to 21 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 20 bas 0 r/w sram with byte se lection byte access select specifies the wen and rd/ wr signal timing when the sram interface with byte selection is used. 0: asserts the wen signal at the read timing and asserts the rd/ wr signal during the write access cycle. 1: asserts the wen signal during the read access cycle and asserts the rd/ wr signal at the write timing. 19 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 188 of 1262 rej09b0437-0100 bit bit name initial value r/w description 10 to 7 wr[3:0] 1010 r/w number of access wait cycles specify the number of cycles that are necessary for read/write access. 0000: no cycle 0001: 1 cycle 0010: 2 cycles 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles 0110: 6 cycles 0111: 8 cycles 1000: 10 cycles 1001: 12 cycles 1010: 14 cycles 1011: 18 cycles 1100: 24 cycles 1101: reserved (setting prohibited) 1110: reserved (setting prohibited) 1111: reserved (setting prohibited) 6 wm 0 r/w external wait mask specification specifies whether or not the external wait input is valid. the specification by this bit is valid even when the number of access wait cycle is 0. 0: external wait input is valid 1: external wait input is ignored 5 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 189 of 1262 rej09b0437-0100 ? cs4wcr 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r r r r r r r r r/w r r/w r/w r/w 0000010100000000 r r r r/w r/w r/w r/w r/w r/w r/w r r r r r/w r/w bit: initial value: r/w: bit: initial value: r/w: -----------bas- ww[2:0] - - - sw[1:0] wr[3:0] wm - - - - hw[1:0] bit bit name initial value r/w description 31 to 21 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 20 bas 0 r/w sram with byte se lection byte access select specifies the wen and rd/ wr signal timing when the sram interface with byte selection is used. 0: asserts the wen signal at the read timing and asserts the rd/ wr signal during the write access cycle. 1: asserts the wen signal during the read access cycle and asserts the rd/ wr signal at the write timing. 19 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 18 to 16 ww[2:0] 000 r/w number of write access wait cycles specify the number of cycles that are necessary for write access. 000: the same cycles as wr[3:0] setting (number of read access wait cycles) 001: no cycle 010: 1 cycle 011: 2 cycles 100: 3 cycles 101: 4 cycles 110: 5 cycles 111: 6 cycles
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 190 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12, 11 sw[1:0] 00 r/w number of delay cycles from address, cs4 assertion to rd , we assertion specify the number of delay cycles from address and cs4 assertion to rd and we assertion. 00: 0.5 cycles 01: 1.5 cycles 10: 2.5 cycles 11: 3.5 cycles 10 to 7 wr[3:0] 1010 r/w number of read access wait cycles specify the number of cycles that are necessary for read access. 0000: no cycle 0001: 1 cycle 0010: 2 cycles 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles 0110: 6 cycles 0111: 8 cycles 1000: 10 cycles 1001: 12 cycles 1010: 14 cycles 1011: 18 cycles 1100: 24 cycles 1101: reserved (setting prohibited) 1110: reserved (setting prohibited) 1111: reserved (setting prohibited)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 191 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 wm 0 r/w external wait mask specification specifies whether or not the external wait input is valid. the specification by this bit is valid even when the number of access wait cycle is 0. 0: external wait input is valid 1: external wait input is ignored 5 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 hw[1:0] 00 r/w delay cycles from rd, wen negation to address, cs4 negation specify the number of delay cycles from rd and wen negation to address and cs4 negation. 00: 0.5 cycles 01: 1.5 cycles 10: 2.5 cycles 11: 3.5 cycles
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 192 of 1262 rej09b0437-0100 ? cs5wcr 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r r r r r r r r/w r/w r r/w r/w r/w 0000010100000000 r r r r/w r/w r/w r/w r/w r/w r/w r r r r r/w r/w bit: initial value: r/w: bit: initial value: r/w: ---------- szsel mpxw/ bas - ww[2:0] - - - sw[1:0] wr[3:0] wm - - - - hw[1:0] bit bit name initial value r/w description 31 to 22 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 20 bas 0 r/w sram with byte selection byte access select specifies the wen and rd/ wr signal timing when the sram interface with byte selection is used. 0: asserts the wen signal at the read timing and asserts the rd/ wr signal during the write access cycle. 1: asserts the wen signal during the read access cycle and asserts the rd/ wr signal at the write timing. 19 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 18 to 16 ww[2:0] 000 r/w number of write access wait cycles specify the number of cycles that are necessary for write access. 000: the same cycles as wr[3:0] setting (number of read access wait cycles) 001: no cycle 010: 1 cycle 011: 2 cycles 100: 3 cycles 101: 4 cycles 110: 5 cycles 111: 6 cycles
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 193 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12, 11 sw[1:0] 00 r/w number of delay cycles from address, cs5 assertion to rd , wen assertion specify the number of delay cycles from address and cs5 assertion to rd and wen assertion. 00: 0.5 cycles 01: 1.5 cycles 10: 2.5 cycles 11: 3.5 cycles 10 to 7 wr[3:0] 1010 r/w number of read access wait cycles specify the number of cycles that are necessary for read access. 0000: no cycle 0001: 1 cycle 0010: 2 cycles 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles 0110: 6 cycles 0111: 8 cycles 1000: 10 cycles 1001: 12 cycles 1010: 14 cycles 1011: 18 cycles 1100: 24 cycles 1101: reserved (setting prohibited) 1110: reserved (setting prohibited) 1111: reserved (setting prohibited) 6 wm 0 r/w external wait mask specification specifies whether or not the external wait input is valid. the specification by this bit is valid even when the number of access wait cycle is 0. 0: external wait input is valid 1: external wait input is ignored
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 194 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 hw[1:0] 00 r/w delay cycles from rd, wen negation to address, cs5 negation specify the number of delay cycles from rd and wen negation to address and cs5 negation. 00: 0.5 cycles 01: 1.5 cycles 10: 2.5 cycles 11: 3.5 cycles ? cs6wcr 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrr/wrrrr 0000010100000000 r r r r/w r/w r/w r/w r/w r/w r/w r r r r r/w r/w bit: initial value: r/w: bit: initial value: r/w: -----------bas---- - - - sw[1:0] wr[3:0] wm - - - - hw[1:0] bit bit name initial value r/w description 31 to 21 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 20 bas 0 r/w sram with byte se lection byte access select specifies the wen and rd/ wr signal timing when the sram interface with byte selection is used. 0: asserts the wen signal at the read timing and asserts the rd/ wr signal during the write access cycle. 1: asserts the wen signal during the read/write access cycle and asserts the rd/ wr signal at the write timing.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 195 of 1262 rej09b0437-0100 bit bit name initial value r/w description 19 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12, 11 sw[1:0] 00 r/w number of delay cycles from address, cs6 assertion to rd , wen assertion specify the number of del ay cycles from address, cs6 assertion to rd and wen assertion. 00: 0.5 cycles 01: 1.5 cycles 10: 2.5 cycles 11: 3.5 cycles 10 to 7 wr[3:0] 1010 r/w number of access wait cycles specify the number of cycles that are necessary for read/write access. 0000: no cycle 0001: 1 cycle 0010: 2 cycles 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles 0110: 6 cycles 0111: 8 cycles 1000: 10 cycles 1001: 12 cycles 1010: 14 cycles 1011: 18 cycles 1100: 24 cycles 1101: reserved (setting prohibited) 1110: reserved (setting prohibited) 1111: reserved (setting prohibited)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 196 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 wn 0 r/w external wait mask specification specifies whether or not the external wait input is valid. the specification of this bit is valid even when the number of access wait cycles is 0. 0: the external wait input is valid 1: the external wait input is ignored 5 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 hw[1:0] 00 r/w number of delay cycles from rd , wen negation to address, cs6 negation specify the number of delay cycles from rd , wen negation to address, and cs6 negation. 00: 0.5 cycles 01: 1.5 cycles 10: 2.5 cycles 11: 3.5 cycles
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 197 of 1262 rej09b0437-0100 (2) sdram ? cs3wcr 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000010100000000 r r/w r/w r r/w r/w r r/w r/w r r r/w r/w r r/w r/w bit: initial value: r/w: bit: initial value: r/w: ---------------- - wtrp[1:0] wtrcd[1:0] trwl[1:0] wtrc[1:0] - - a3cl[1:0] - - - bit bit name initial value r/w description 31 to 15 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 14, 13 wtrp[1:0] 00 r/w number of auto-precharge completion wait cycles specify the number of minimum precharge completion wait cycles as shown below. ? from the start of auto- precharge and issuing of actv command for the same bank ? from issuing of the pre/pall command to issuing of the actv command for the same bank ? till entering the power-down mode or deep power- down mode ? from the issuing of pall command to issuing ref command in auto refresh mode ? from the issuing of pall command to issuing self command in self refresh mode 00: no cycle 01: 1 cycle 10: 2 cycles 11: 3 cycles
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 198 of 1262 rej09b0437-0100 bit bit name initial value r/w description 12 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 11, 10 wtrcd[1:0] 01 r/w nu mber of wait cycles between actv command and read(a)/writ(a) command specify the minimum number of wait cycles from issuing the actv command to issuing the read(a)/writ(a) command. 00: no cycle 01: 1 cycle 10: 2 cycles 11: 3 cycles 9 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 8, 7 a3cl[1:0] 10 r/w cas latency for area 3 specify the cas latency for area 3. 00: 1 cycle 01: 2 cycles 10: 3 cycles 11: 4 cycles 6, 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 199 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4, 3 trwl[1:0] 00 r/w number of auto-precharge startup wait cycles specify the number of minimum auto-precharge startup wait cycles as shown below. ? cycle number from the issuance of the writa command by this lsi until the completion of auto- precharge in the sdram. equivalent to the cycle number from the issuance of the writa command unt il the issuance of the actv command. confirm that how many cycles are required between the write command receive in the sdram and the auto-precharge activation, referring to each sdram data sheet. and set the cycle number so as not to exceed the cycle number specified by this bit. ? cycle number from the issuance of the writa command until the issuance of the pre command. this is the case when accessing another low address in the same bank in bank active mode. 00: no cycle 01: 1 cycle 10: 2 cycles 11: 3 cycles 2 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 200 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1, 0 wtrc[1:0] 00 r/w number of id le cycles from ref command/self- refresh release to actv/ref/mrs command specify the number of mi nimum idle cycles in the periods shown below. ? from the issuance of the ref command until the issuance of the actv/ref/mrs command ? from releasing self-refresh until the issuance of the actv/ref/mrs command. 00: 2 cycles 01: 3 cycles 10: 5 cycles 11: 8 cycles
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 201 of 1262 rej09b0437-0100 (3) pcmcia ? cs5wcr, cs6wcr 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrr/wr/wrrrr 0000010100000000 r r/w r/w r/w r/w r/w r/w r/w r/w r r r r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: ---------- sa[ 1:0] - - - - - ted[3:0] pcw[3:0] teh[3:0] wm - - bit bit name initial value r/w description 31 to 22 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 21, 20 sa[1:0] 00 r/w space attribute specification select memory card interf ace or i/o card interface when pcmcia interface is selected. sa1: 0: selects memory card interface for the space for a25 = 1. 1: selects i/o card interface for the space for a25 = 1. sa0: 0: selects memory card interface for the space for a25 = 0. 1: selects i/o card interface for the space for a25 = 0. 19 to 15 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 202 of 1262 rej09b0437-0100 bit bit name initial value r/w description 14 to 11 ted[3:0] 0000 r/w number of de lay cycles from address output to rd / we assertion specify the number of del ay cycles from address output to rd / we assertion for the memory card or to iciord / iciowr assertion for the i/o card in pcmcia interface. 0000: 0.5 cycle 0001: 1.5 cycles 0010: 2.5 cycles 0011: 3.5 cycles 0100: 4.5 cycles 0101: 5.5 cycles 0110: 6.5 cycles 0111: 7.5 cycles 1000: 8.5 cycles 1001: 9.5 cycles 1010: 10.5 cycles 1011: 11.5 cycles 1100: 12.5 cycles 1101: 13.5 cycles 1110: 14.5 cycles 1111: 15.5 cycles
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 203 of 1262 rej09b0437-0100 bit bit name initial value r/w description 10 to 7 pcw[3:0] 1010 r/w number of access wait cycles specify the number of wait cycles to be inserted. 0000: 3 cycles 0001: 6 cycles 0010: 9 cycles 0011: 12 cycles 0100: 15 cycles 0101: 18 cycles 0110: 22 cycles 0111: 26 cycles 1000: 30 cycles 1001: 33 cycles 1010: 36 cycles 1011: 38 cycles 1100: 52 cycles 1101: 60 cycles 1110: 64 cycles 1111: 80 cycles 6 wm 0 r/w external wait mask specification specifies whether or not the external wait input is valid. the specification by this bit is valid even when the number of access wait cycles is 0. 0: external wait input is valid 1: external wait input is ignored 5, 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 204 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 to 0 teh[3:0] 0000 r/w delay cycles from rd / we negation to address specify the number of address hold cycles from rd / we negation for the memory card or those from iciord / iciowr negation for the i/o card in pcmcia interface. 0000: 0.5 cycle 0001: 1.5 cycles 0010: 2.5 cycles 0011: 3.5 cycles 0100: 4.5 cycles 0101: 5.5 cycles 0110: 6.5 cycles 0111: 7.5 cycles 1000: 8.5 cycles 1001: 9.5 cycles 1010: 10.5 cycles 1011: 11.5 cycles 1100: 12.5 cycles 1101: 13.5 cycles 1110: 14.5 cycles 1111: 15.5 cycles
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 205 of 1262 rej09b0437-0100 7.4.4 sdram control register (sdcr) sdcr specifies the method to refresh and acce ss sdram, and the types of sdrams to be connected. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r/w r r/w r/w r/w r/w r r r r/w r/w r r/w r/w ????????????? a3row[1:0] a3col[1:0] ??? ?? deep ? rfsh rmodepdown bactv ??? ? bit bit name initial value r/w description 31 to 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13 deep 0 r/w deep power-down mode this bit is valid for low-power sdram. if the rfsh or rmode bit is set to 1 while this bit is set to 1, the deep power-down entry command is issued and the low- power sdram enters the deep power-down mode. 0: self-refresh mode 1: deep power-down mode 12 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 11 rfsh 0 r/w refresh control specifies whether or not t he refresh operation of the sdram is performed. 0: no refresh 1: refresh
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 206 of 1262 rej09b0437-0100 bit bit name initial value r/w description 10 rmode 0 r/w refresh control specifies whether to perform auto-refresh or self- refresh when the rfsh bit is 1. when the rfsh bit is 1 and this bit is 1, self-refresh starts immediately. when the rfsh bit is 1 and this bit is 0, auto-refresh starts according to the contents that are set in registers rtcsr, rtcnt, and rtcor. 0: auto-refresh is performed 1: self-refresh is performed 9 pdown 0 r/w power-down mode specifies whether the s dram will enter the power- down mode after the access to the sdram. with this bit being set to 1, after the sdram is accessed, the cke signal is driven low and the sdram enters the power-down mode. 0: the sdram does not enter the power-down mode after being accessed. 1: the sdram enters the power-down mode after being accessed. 8 bactv 0 r/w bank active mode specifies to access whether in auto-precharge mode (using reada and writa commands) or in bank active mode (using read and writ commands). 0: auto-precharge mode (using reada and writa commands) 1: bank active mode (using read and writ commands) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 207 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4, 3 a3row[1:0] 00 r/w number of bits of row address for area 3 specify the number of bits of the row address for area 3. 00: 11 bits 01: 12 bits 10: 13 bits 11: reserved (setting prohibited) 2 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 1, 0 a3col[1:0] 00 r/w number of bits of column address for area 3 specify the number of bits of the column address for area 3. 00: 8 bits 01: 9 bits 10: 10 bits 11: reserved (setting prohibited)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 208 of 1262 rej09b0437-0100 7.4.5 refresh timer contro l/status register (rtcsr) rtcsr specifies various items about refresh for sdram. when rtcsr is written, the upper 16 bits of the write data must be h'a55a to cancel write protection. the phase of the clock for incr ementing the count in the refresh timer counter (rtcnt) is adjusted only by a power-on reset. note that ther e is an error in the time until the compare match flag is set for the first time after the timer is st arted with the cks[2:0] bits being set to a value other than b'000. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: ---------------- - - - - - - - - cmf cmie cks[2:0] rrc[2:0] bit bit name initial value r/w description 31 to 8 ? all 0 r reserved these bits are always read as 0. 7 cmf 0 r/w compare match flag indicates that a compare match occurs between the refresh timer counter (rtcnt) and refresh time constant register (rtcor). this bit is set or cleared in the following conditions. 0: clearing condition: when 0 is written in cmf after reading out rtcsr during cmf = 1. 1: setting condition: when the condition rtcnt = rtcor is satisfied.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 209 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 cmie 0 r/w compare match interrupt enable enables or disables cmf interrupt requests when the cmf bit in rtcsr is set to 1. 0: disables cmf interrupt requests. 1: enables cmf interrupt requests. 5 to 3 cks[2:0] 000 r/w clock select select the clock input to count-up the refresh timer counter (rtcnt). 000: stop the counting-up 001: b /4 010: b /16 011: b /64 100: b /256 101: b /1024 110: b /2048 111: b /4096 2 to 0 rrc[2:0] 000 r/w refresh count specify the number of cont inuous refresh cycles, when the refresh request occurs after the coincidence of the values of the refresh ti mer counter (rtcnt) and the refresh time constant register (rtcor). these bits can make the period of occurrence of refresh long. 000: 1 time 001: 2 times 010: 4 times 011: 6 times 100: 8 times 101: reserved (setting prohibited) 110: reserved (setting prohibited) 111: reserved (setting prohibited)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 210 of 1262 rej09b0437-0100 7.4.6 refresh time r counter (rtcnt) rtcnt is an 8-bit counter that increments using the clock selected by bits cks[2:0] in rtcsr. when rtcnt matches rtcor, rtcnt is cleared to 0. the value in rtcnt returns to 0 after counting up to 255. when the rtcnt is written, the upper 16 bits of the write data must be h'a55a to cancel write protection. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: ---------------- -------- bit bit name initial value r/w description 31 to 8 ? all 0 r reserved these bits are always read as 0. 7 to 0 all 0 r/w 8-bit counter
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 211 of 1262 rej09b0437-0100 7.4.7 refresh time constant register (rtcor) rtcor is an 8-bit register. when rtcor matche s rtcnt, the cmf bit in rtcsr is set to 1 and rtcnt is cleared to 0. when the rfsh bit in sdcr is 1, a memory refr esh request is issued by this matching signal. this request is maintained until the refresh opera tion is performed. if the request is not processed when the next matching occurs, the previous request is ignored. when the cmie bit in rtcsr is set to 1, an inte rrupt request is issued by this matching signal. the request continues to be output until the cmf bit in rtcsr is cleared. clearing the cmf bit only affects the interrupt request and does not clear the refresh re quest. therefore, a combination of refresh request and interval timer interrupt can be specified so that the number of refresh requests are counted by using timer interrup ts while refresh is performed periodically. when rtcor is written, the upper 16 bits of th e write data must be h'a55a to cancel write protection. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: ???????????????? ???????? bit bit name initial value r/w description 31 to 8 ? all 0 r reserved these bits are always read as 0. 7 to 0 all 0 r/w 8-bit counter
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 212 of 1262 rej09b0437-0100 7.4.8 ac characteristics switching register (acswr) to use the sdram in clock mode 0 or 1, set the ac characteristics switching register (acswr) and ac characteristics key switching register (ackeyr). in clock mode 2 or 3, set nothing to keep the initial value. only a special sequence can write to this regi ster to prevent accidental erroneous write. the setting procedure is shown in section 7.4.10, sequence to write to acswr. read is done by the normal longword. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r r r r r r r r r r r/w r/w r/w r/w ---------------- - - - - - - - - - - - - acosw[3:0] bit: initial value: r/w: bit: initial value: r/w: bit bit name initial value r/w description 31 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 to 0 acosw[3:0] 0000 r/w ac characteristics switch specifies ac characteristics switching 0000: not extend the delay time 1001: switches characteri stics and extends the delay time others: setting prohibited
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 213 of 1262 rej09b0437-0100 7.4.9 ac characteristics switching key register (ackeyr) ackeyr is a write only 8-bit register to acce ss the ac characteristics switching register (acswr). the write value is ignored and the read value is undefined. 7654321 0 -------- wwwwwwww bit: initial value: r/w: ackey[7:0] bit bit name initial value r/w description 7 to 0 ackey[7:0] ? w ac key writing to this bit is required to write to the acswr register. the write value is arbitrary.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 214 of 1262 rej09b0437-0100 7.4.10 sequence to write to acswr figure 7.2 shows the sequence to write to acswr. write must be executed in the on-chip ram. main program routine subroutine executed in on-chip ram (1) (2) (3) (4) incorrectly written correcrly written make sure to read and confirm as in step (4) after the write in step (3). if incorrectly written, execute from step (1) again. transfer write subroutine to on-chip ram write subroutine return byte write to ackeyr byte write to ackeyr longword write to acswr read acswr to confirm execute write subroutine figure 7.2 recommended sequence to write to acswr
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 215 of 1262 rej09b0437-0100 7.4.11 internal bus master bus priority register (ibmpr) ibmpr is a 32-bit register that sets the bus prio rity for the internal bu s masters excluding the cpu. if internal bus masters excluding the same cpu are se t at different priority levels, the highest one will be effective. after an attempt to set internal bus masters in an overlapping manner, if some of them failed to be set, then these failing bus mast ers will not be able to acquire bus mastership. rewriting this register while any of the a-dmac (including f-dmac), e-dmac, and dmac is operating is prohibited. when rewriting this register, make sure that none of the a-dmac (including f-dmac), e-dmac, and dmac is not started. for details, see section 7.5.9 (2), access from the side of the lsi internal bus master. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value r/w: bit: initial value r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0001001000110000 r r r/w r/w r r r/w r/w r r r/w r/w r r r r 00000000 rrrrrrrr 00000000 rrrrrrrr ?? 0p1r[1:0] ?? 0p2r[1:0] ?? 0p3r[1:0] ???? ???????????????? bit bit name initial value r/w description 31, 30 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 29, 28 0p1r[1:0] 01 r/w of the internal bus masters excluding the cpu (that is, a-dmac (including f-dmac), e-dmac, and dmac), set the internal bus master having the highest priority level. 00: no setting 01: a-dmac (including f-dmac) 10: e-dmac 11: dmac
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 216 of 1262 rej09b0437-0100 bit bit name initial value r/w description 27, 26 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 25, 24 0p2r[1:0] 10 r/w of the internal bus masters excluding the cpu (that is, a-dmac (including f-dmac), e-dmac, and dmac), set the internal bus master having the second highest priority level. 00: no setting 01: a-dmac (including f-dmac) 10: e-dmac 11: dmac 23, 22 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 21, 20 0p3r[1:0] 11 r/w of the internal bus masters excluding the cpu (that is, a-dmac (including f-dmac), e-dmac, and dmac), set the internal bus master having the third highest priority level. 00: no setting 01: a-dmac (including f-dmac) 10: e-dmac 11: dmac 19 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 217 of 1262 rej09b0437-0100 7.5 operation 7.5.1 endian/access size and data alignment this lsi supports both big endian, in which the most significant byte (msb) of data is that in the direction of the 0th address, and little endian, in which the least significant byte (lsb) is that in the direction of the 0th address. in the initial stat e after a power-on reset, all areas will be in big endian mode. little endian cannot be selected for area 0. however, the endian of areas 3 to 6 can be changed by the setting in the csnbcr register setting as long as the target space is not being accessed. three data bus widths (8 bits, 16 bits, and 32 b its) are selectable for areas 3 to 6, allowing the connection of normal memory and of sram with byte selection. two data bus widths (16 bits and 32 bits) are available for sdram. two data bus widths (8 bits and 16 bits) are available for the pcmcia interface. for mpx-i/o, the data bus width can be fixed to either 8 or 16 bits, or made selectable as 8 bits or 16 bits by one of the addr ess lines. data alignment is in accord with the data bus width selected for the device. this also means that four read operations are required to read longword data from a byte-width device. in this lsi, data alignment and conversion of data length is performed automatically between the respective interfaces. the data bus width of area 0 is fixed to 8 bits or 16 bits by the md_bw pin setting at a power-on reset. tables 7.5 to 7.10 show the relationship between device data width and access unit. note that the correspondence between addresses and strobe signals for the 32- and 16-bit bus widths depends on the endian setting. for example, with big endian and a 32-bit bus width, we3 corresponds to the 0th address, which is represented by we0 when little endian has been selected. little endian cannot be selected for area 0. note also that 32-bit and 16-bit accesses coincide in instruction fetching, therefore, it is difficult to allocate instruc tion to little endian area. make sure to execute instruction in big endian area.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 218 of 1262 rej09b0437-0100 table 7.5 32-bit external device access and data alignment in big endian data bus strobe signals operation d31 to d24 d23 to d16 d15 to d8 d7 to d0 we3 , dqmuu we2 , dqmul we1 , dqmlu we0 , dqmll byte access at 0 data 7 to 0 ? ? ? assert ? ? ? byte access at 1 ? data 7 to 0 ? ? ? assert ? ? byte access at 2 ? ? data 7 to 0 ? ? ? assert ? byte access at 3 ? ? ? data 7 to 0 ? ? ? assert word access at 0 data 15 to 8 data 7 to 0 ? ? assert assert ? ? word access at 2 ? ? data 15 to 8 data 7 to 0 ? ? assert assert longword access at 0 data 31 to 24 data 23 to 16 data 15 to 8 data 7 to 0 assert assert assert assert
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 219 of 1262 rej09b0437-0100 table 7.6 16-bit external device access and data alignment in big endian data bus strobe signals operation d31 to d24 d23 to d16 d15 to d8 d7 to d0 we3 , dqmuu we2 , dqmul we1 , dqmlu we0 , dqmll byte access at 0 ? ? data 7 to 0 ? ? ? assert ? byte access at 1 ? ? ? data 7 to 0 ? ? ? assert byte access at 2 ? ? data 7 to 0 ? ? ? assert ? byte access at 3 ? ? ? data 7 to 0 ? ? ? assert word access at 0 ? ? data 15 to 8 data 7 to 0 ? ? assert assert word access at 2 ? ? data 15 to 8 data 7 to 0 ? ? assert assert 1st time at 0 ? ? data 31 to 24 data 23 to 16 ? ? assert assert longword access at 0 2nd time at 2 ? ? data 15 to 8 data 7 to 0 ? ? assert assert
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 220 of 1262 rej09b0437-0100 table 7.7 8-bit external device access and data alignment in big endian data bus strobe signals operation d31 to d24 d23 to d16 d15 to d8 d7 to d0 we3 , dqmuu we2 , dqmul we1 , dqmlu we0 , dqmll byte access at 0 ? ? ? data 7 to 0 ? ? ? assert byte access at 1 ? ? ? data 7 to 0 ? ? ? assert byte access at 2 ? ? ? data 7 to 0 ? ? ? assert byte access at 3 ? ? ? data 7 to 0 ? ? ? assert 1st time at 0 ? ? ? data 15 to 8 ? ? ? assert word access at 0 2nd time at 1 ? ? ? data 7 to 0 ? ? ? assert 1st time at 2 ? ? ? data 15 to 8 ? ? ? assert word access at 2 2nd time at 3 ? ? ? data 7 to 0 ? ? ? assert 1st time at 0 ? ? ? data 31 to 24 ? ? ? assert 2nd time at 1 ? ? ? data 23 to 16 ? ? ? assert 3rd time at 2 ? ? ? data 15 to 8 ? ? ? assert longword access at 0 4th time at 3 ? ? ? data 7 to 0 ? ? ? assert
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 221 of 1262 rej09b0437-0100 table 7.8 32-bit external device access and data alignment in little endian data bus strobe signals operation d31 to d24 d23 to d16 d15 to d8 d7 to d0 we3 , dqmuu we2 , dqmul we1 , dqmlu we0 , dqmll byte access at 0 ? ? ? data 7 to 0 ? ? ? assert byte access at 1 ? ? data 7 to 0 ? ? ? assert ? byte access at 2 ? data 7 to 0 ? ? ? assert ? ? byte access at 3 data 7 to 0 ? ? ? assert ? ? ? word access at 0 ? ? data 15 to 8 data 7 to 0 ? ? assert assert word access at 2 data 15 to 8 data 7 to 0 ? ? assert assert ? ? longword access at 0 data 31 to 24 data 23 to 16 data 15 to 8 data 7 to 0 assert assert assert assert
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 222 of 1262 rej09b0437-0100 table 7.9 16-bit external device access and data alignment in little endian data bus strobe signals operation d31 to d24 d23 to d16 d15 to d8 d7 to d0 we3 , dqmuu we2 , dqmul we1 , dqmlu we0 , dqmll byte access at 0 ? ? ? data 7 to 0 ? ? ? assert byte access at 1 ? ? data 7 to 0 ? ? ? assert ? byte access at 2 ? ? ? data 7 to 0 ? ? ? assert byte access at 3 ? ? data 7 to 0 ? ? ? assert ? word access at 0 ? ? data 15 to 8 data 7 to 0 ? ? assert assert word access at 2 ? ? data 15 to 8 data 7 to 0 ? ? assert assert 1st time at 0 ? ? data 15 to 8 data 7 to 0 ? ? assert assert longword access at 0 2nd time at 2 ? ? data 31 to 24 data 23 to 16 ? ? assert assert
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 223 of 1262 rej09b0437-0100 table 7.10 8-bit external device access and data alignment in little endian data bus strobe signals operation d31 to d24 d23 to d16 d15 to d8 d7 to d0 we3 , dqmuu we2 , dqmul we1 , dqmlu we0 , dqmll byte access at 0 ? ? ? data 7 to 0 ? ? ? assert byte access at 1 ? ? ? data 7 to 0 ? ? ? assert byte access at 2 ? ? ? data 7 to 0 ? ? ? assert byte access at 3 ? ? ? data 7 to 0 ? ? ? assert 1st time at 0 ? ? ? data 7 to 0 ? ? ? assert word access at 0 2nd time at 1 ? ? ? data 15 to 8 ? ? ? assert 1st time at 2 ? ? ? data 7 to 0 ? ? ? assert word access at 2 2nd time at 3 ? ? ? data 15 to 8 ? ? ? assert 1st time at 0 ? ? ? data 7 to 0 ? ? ? assert 2nd time at 1 ? ? ? data 15 to 8 ? ? ? assert 3rd time at 2 ? ? ? data 23 to 16 ? ? ? assert longword access at 0 4th time at 3 ? ? ? data 31 to 24 ? ? ? assert
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 224 of 1262 rej09b0437-0100 7.5.2 normal space interface (1) basic timing for access to a normal space, this lsi uses strobe signal output in consider ation of the fact that mainly static ram will be directly connected. when using sram with a byte-selection pin, see section 7.5.6, sram interface with byte selection. figure 7.3 shows the basic timings of normal space access. a no-wait normal access is completed in two cycles. the bs signal is asserted for one cycle to indicate the start of a bus cycle. ckio note: * the waveform for dackn is when active low is specified. a25 to a0 rd/ wr rd/ wr d31 to d0 dackn csn t1 t2 rd wen bs d31 to d0 read write * figure 7.3 normal space basi c access timing (access wait 0) there is no access size specification when reading. the correct access start ad dress is output in the least significant bit of the address, but since there is no access size specification, 32 bits are always
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 225 of 1262 rej09b0437-0100 read in case of a 32-bit device, and 16 bits in case of a 16-bit device. when writing, only the wen signal for the byte to be written is asserted. it is necessary to output the data that has been read using rd when a buffer is established in the data bus. the rd/ wr signal is in a read state (high output ) when no access has been carried out. therefore, care must be taken when controlling th e external data buffer, to avoid collision. figures 7.4 and 7.5 show the basic timings of normal sp ace access. if the wm bit in csnwcr is cleared to 0, a tnop cycle is inserted after th e csn space access to evaluate the external wait (figure 7.4). if the wm bit in csnwcr is set to 1, external waits are ignored and no tnop cycle is inserted (figure 7.5). ckio a25 to a0 rd rd/ wr d15 to d0 wen d15 to d0 dackn bs wait csn t1 t2 tnop t1 t2 read write * note: * the waveform for dackn is when active low is specified. figure 7.4 continuous access for normal space 1 bus width = 16 bits, longword access, csnwcr.wm bit = 0 (access wait = 0, cycle wait = 0)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 226 of 1262 rej09b0437-0100 ckio a25 to a0 rd/ wr d15 to d0 dackn csn t1 t2 t1 t2 rd wen bs wait d15 to d0 read write * note: * the waveform for dackn is when active low is specified. figure 7.5 continuous access for normal space 2 bus width = 16 bits, longword access, csnwcr.wm bit = 1 (access wait = 0, cycle wait = 0)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 227 of 1262 rej09b0437-0100      a16 a0 cs oe i/o7 i/o0 we     a18 a2 csn rd d31 d24 we3 d23 d16 we2 d15 d8 we1 d7 d0 we0 this lsi 128k 8-bit sram  a16 a0 cs oe i/o7 i/o0 we      a16 a0 cs oe i/o7 i/o0 we     a16 a0 cs oe i/o7 i/o0 we      figure 7.6 example of 32-bit data-width sram connection
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 228 of 1262 rej09b0437-0100 a16 a0 cs oe i/o7 i/o0 we     a17 a1 csn rd d15 d8 we1 d7 d0 we0 this lsi 128k 8-bit sram  a16 a0 cs oe i/o7 i/o0 we         figure 7.7 example of 16-bit data-width sram connection this lsi 128k 8-bit sram a16 a0 cs oe i/o7 i/o0 we . . . a16 a0 csn rd d7 d0 we0 . . . . . . . . . figure 7.8 example of 8-bit data-width sram connection
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 229 of 1262 rej09b0437-0100 7.5.3 access wait control wait cycle insertion on a normal space access can be controlled by the settings of bits wr3 to wr0 in csnwcr. it is possible for areas 4 and 5 to insert wait cycles independently in read access and in write access. areas 0, 3, and 6 have common access wait for read cycle and write cycle. the specified number of tw cycles are in serted as wait cycles in a normal space access shown in figure 7.9. t1 ckio a25 to a0 csn rd/ wr rd d31 to d0 wen d31 to d0 bs tw read write t2 dackn * note: * the waveform for dackn is when active low is specified. figure 7.9 wait timing for normal space access (software wait only)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 230 of 1262 rej09b0437-0100 when the wm bit in csnwcr is clear ed to 0, the external wait input wait signal is also sampled. wait pin sampling is shown in figure 7.10. a 2-cycle wait is specified as a software wait. the wait signal is sampled on the falling edge of ckio at the transition from the t1 or tw cycle to the t2 cycle. t1 ckio a25 to a0 csn rd/ wr rd d31 to d0 wen d31 to d0 wait tw tw twx t2 read write bs wait states inserted by wait signal dackn * note: * the waveform for dackn is when active low is specified. figure 7.10 wait cycle timi ng for normal space access (wait cycle insertion using wait signal)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 231 of 1262 rej09b0437-0100 7.5.4 csn assert period expansion the number of cycles from csn assertion to rd , wen assertion can be specified by setting bits sw1 and sw0 in csnwcr. the number of cycles from rd , wen negation to csn negation can be specified by setting bits hw1 and hw0. therefor e, a flexible interface to an external device can be obtained. figure 7.11 shows an example. a th cycle and a tf cycle are added before and after an ordinary cycle, re spectively. in these cycles, rd and wen are not asserted, while other signals are asserted. the data output is prolonged to the tf cycle, and this prolongation is useful for devices with slow writing operations. t1 ckio a25 to a0 csn rd/ wr rd d31 to d0 wen d31 to d0 bs th read write t2 dackn * tf note: * the waveform for dackn is when active low is specified. figure 7.11 csn assert period expansion
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 232 of 1262 rej09b0437-0100 7.5.5 sdram interface (1) sdram direct connection the sdram that can be connected to this lsi is a product that has 11/12/13 bits of row address, 8/9/10 bits of column address, 4 or less banks, and uses the a10 pin for setting precharge mode in read and write command cycles. the control signals for dir ect connection of sdram are ras , cas , rd/ wr , dqmuu, dqmul, dqmlu, dqmll, cke, and cs3 . all the signals other than cs3 are common to all areas, and signals other than cke are valid when cs2 or cs3 is asserted. sdram can be connected to up to 2 spaces . the data bus width of the area that is connected to sdram can be set to 32 or 16 bits. burst read/single write (burst length 1) and burst re ad/burst write (burst length 1) are supported as the sdram operating mode. commands for sdram can be specified by ras , cas , rd/ wr , and specific address signals. these commands supports: ? nop ? auto-refresh (ref) ? self-refresh (self) ? all banks pre-charge (pall) ? specified bank pre-charge (pre) ? bank active (actv) ? read (read) ? read with pre-charge (reada) ? write (writ) ? write with pre-charge (writa) ? write mode register (mrs, emrs) the byte to be accessed is specified by dq muu, dqmul, dqmlu, and dqmll. reading or writing is performed for a byte whose corresponding dqmxx is low. for details on the relationship between dqmxx and the byte to be accessed, see section 7.5.1, endian/access size and data alignment. figures 7.12 to 7.13 show examples of the connection of the sdram with the lsi.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 233 of 1262 rej09b0437-0100 a15 a2 cke ckio csn ras cas rd/ wr d31 d16 dqmuu dqmul d15 d0 dqmlu dqmll 64m sdram (1m 16bits 4bank) a13 a0 cke clk cs ras cas we i/o15 i/o0 dqmu dqml a13 a0 cke clk cs ras cas we i/o15 i/o0 dqmu dqml this lsi ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? figure 7.12 example of 32-bi t data width sdram connection
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 234 of 1262 rej09b0437-0100 a14 a1 cke ckio csn ras cas rd/ wr d15 d0 dqmlu dqmll a13 a0 cke clk cs ras cas we i/o15 i/o0 dqmu dqml this lsi ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 64m sdram (1m 16bits 4bank) figure 7.13 example of 16-bi t data width sdram connection
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 235 of 1262 rej09b0437-0100 (2) address multiplexing an address multiplexing is specified so that sdram can be connected without external multiplexing circuitry according to the setting of bits bsz[1:0] in csnbcr, bits a2row[1:0], and a2col[1:0], a3row[1:0], and a3col[1:0] in sdcr. tables 7.11 to 7.16 show the relationship between the settings of bits bsz[1:0], a2row[1:0], a2col[1:0], a3row[1:0], and a3col[1:0] and the bits output at the address pins. do not specify those bits in the manner other than this table, otherwise the operation of th is lsi is not guaranteed. a25 to a18 are not multiplexed and the original values of address are always output at these pins. when the data bus width is 16 bits (bsz1 and bsz0 = b'10), a0 of sdram specifies a word address. therefore, connect this a0 pin of sdram to the a1 pin of the lsi; the a1 pin of sdram to the a2 pin of the lsi, and so on. when the data bus width is 32 bits (bsz1 and bsz0 = b'11), the a0 pin of sdram specifies a longwor d address. therefore, co nnect this a0 pin of sdram to the a2 pin of the lsi; the a1 pin of sdram to the a3 pin of the lsi, and so on.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 236 of 1262 rej09b0437-0100 table 7.11 relationship between bsz[1:0], a3row[1:0], a3col[1:0], and address multiplex output (1)-1 setting bsz[1:0] a3row[1:0] a3col[1:0] 11 (32 bits) 00 (11 bits) 00 (8 bits) output pin of this lsi row address output column address output sdram pin function a17 a25 a17 a16 a24 a16 a15 a23 a15 unused a14 a22 * 2 * 3 a22 * 2 * 3 a12 (ba1) a13 a21 * 2 a21 * 2 a11 (ba0) specifies bank a12 a20 l/h * 1 a10/ap specifies address/precharge a11 a19 a11 a9 a10 a18 a10 a8 a9 a17 a9 a7 a8 a16 a8 a6 a7 a15 a7 a5 a6 a14 a6 a4 a5 a13 a5 a3 a4 a12 a4 a2 a3 a11 a3 a1 a2 a10 a2 a0 address a1 a9 a1 a0 a8 a0 unused example of connected memory 64-mbit product (512 kwords 32 bits 4 banks, column 8 bits product): 1 16-mbit product (512 kwords 16 bits 2 banks, column 8 bits product): 2 notes: 1. l/h is a bit used in the command specific ation; it is fixed at l or h according to the access mode. 2. bank address specification 3. applicable only to 64-bit products.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 237 of 1262 rej09b0437-0100 table 7.11 relationship between bsz[1:0], a3row[1:0], a3col[1:0], and address multiplex output (1)-2 setting bsz[1:0] a3row[1:0] a3col[1:0] 11 (32 bits) 01 (12 bits) 00 (8 bits) output pin of this lsi row address output column address output sdram pin function a17 a25 a17 a16 a24 a16 unused a15 a23 * 2 a23 * 2 a13 (ba1) a14 a22 * 2 a22 * 2 a12 (ba0) specifies bank a13 a21 a13 a11 address a12 a20 l/h * 1 a10/ap specifies address/precharge a11 a19 a11 a9 a10 a18 a10 a8 a9 a17 a9 a7 a8 a16 a8 a6 a7 a15 a7 a5 a6 a14 a6 a4 a5 a13 a5 a3 a4 a12 a4 a2 a3 a11 a3 a1 a2 a10 a2 a0 address a1 a9 a1 a0 a8 a0 unused example of connected memory 128-mbit product (1 mword 32 bits 4 banks, column 8 bits product): 1 64-mbit product (1 mword 16 bits 4 banks, column 8 bits product): 2 notes: 1. l/h is a bit used in the command specific ation; it is fixed at l or h according to the access mode. 2. bank address specification 3. applicable only to 64-bit products.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 238 of 1262 rej09b0437-0100 table 7.12 relationship between bsz[1:0], a3row[1:0], a3col[1:0], and address multiplex output (2)-1 setting bsz[1:0] a3row[1:0] a3col[1:0] 11 (32 bits) 01 (12 bits) 01 (9 bits) output pin of this lsi row address output column address output sdram pin function a17 a26 a17 a16 a25 a16 unused a15 a24 * 2 a24 * 2 a13 (ba1) a14 a23 * 2 a23 * 2 a12 (ba0) specifies bank a13 a22 a13 a11 address a12 a21 l/h * 1 a10/ap specifies address/precharge a11 a20 a11 a9 a10 a19 a10 a8 a9 a18 a9 a7 a8 a17 a8 a6 a7 a16 a7 a5 a6 a15 a6 a4 a5 a14 a5 a3 a4 a13 a4 a2 a3 a12 a3 a1 a2 a11 a2 a0 address a1 a10 a1 a0 a9 a0 unused example of connected memory 256-mbit product (2 mwords 32 bits 4 banks, column 9 bits product): 1 128-mbit product (2 mwords 16 bits 4 banks, column 9 bits product): 2 notes: 1. l/h is a bit used in the command specific ation; it is fixed at l or h according to the access mode. 2. bank address specification
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 239 of 1262 rej09b0437-0100 table 7.12 relationship between bsz[1:0], a3row[1:0], a3col[1:0], and address multiplex output (2)-2 setting bsz[1:0] a3row[1:0] a3col[1:0] 11 (32 bits) 01 (12 bits) 10 (10 bits) output pin of this lsi row address output column address output sdram pin function a17 a27 a17 a16 a26 a16 unused a15 a25 * 2 a25 * 2 a13 (ba1) a14 a24 * 2 a24 * 2 a12 (ba0) specifies bank a13 a23 a13 a11 address a12 a22 l/h * 1 a10/ap specifies address/precharge a11 a21 a11 a9 a10 a20 a10 a8 a9 a19 a9 a7 a8 a18 a8 a6 a7 a17 a7 a5 a6 a16 a6 a4 a5 a15 a5 a3 a4 a14 a4 a2 a3 a13 a3 a1 a2 a12 a2 a0 address a1 a11 a1 a0 a10 a0 unused example of connected memory 512-mbit product (4 mwords 32 bits 4 banks, column 10 bits product): 1 256-mbit product (4 mwords 16 bits 4 banks, column 10 bits product): 2 notes: 1. l/h is a bit used in the command specific ation; it is fixed at l or h according to the access mode. 2. bank address specification
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 240 of 1262 rej09b0437-0100 table 7.13 relationship between bsz[1:0], a3row[1:0], a3col[1:0], and address multiplex output (3) setting bsz[1:0] a3row[1:0] a3col[1:0] 11 (32 bits) 10 (13 bits) 01 (9 bits) output pin of this lsi row address output column address output sdram pin function a17 a26 a17 unused a16 a25 * 2 a25 * 2 a14 (ba1) a15 a24 * 2 a24 * 2 a13 (ba0) specifies bank a14 a23 a14 a12 a13 a22 a13 a11 address a12 a21 l/h * 1 a10/ap specifies address/precharge a11 a20 a11 a9 a10 a19 a10 a8 a9 a18 a9 a7 a8 a17 a8 a6 a7 a16 a7 a5 a6 a15 a6 a4 a5 a14 a5 a3 a4 a13 a4 a2 a3 a12 a3 a1 a2 a11 a2 a0 address a1 a10 a1 a0 a9 a0 unused example of connected memory 512-mbit product (4 mwords 32 bits 4 banks, column 9 bits product): 1 256-mbit product (4 mwords 16 bits 4 banks, column 9 bits product): 2 notes: 1. l/h is a bit used in the command specific ation; it is fixed at l or h according to the access mode. 2. bank address specification
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 241 of 1262 rej09b0437-0100 table 7.14 relationship between bsz[1:0], a3row[1:0], a3col[1:0], and address multiplex output (4)-1 setting bsz[1:0] a3row[1:0] a3col[1:0] 10 (16 bits) 00 (11 bits) 00 (8 bits) output pin of this lsi row address output column address output sdram pin function a17 a25 a17 a16 a24 a16 a15 a23 a15 a14 a22 a14 unused a13 a21 * 2 a21 * 2 a12 (ba1) a12 a20 * 2 a20 * 2 a11 (ba0) specifies bank a11 a19 l/h * 1 a10/ap specifies address/precharge a10 a18 a10 a9 a9 a17 a9 a8 a8 a16 a8 a7 a7 a15 a7 a6 a6 a14 a6 a5 a5 a13 a5 a4 a4 a12 a4 a3 a3 a11 a3 a2 a2 a10 a2 a1 a1 a9 a1 a0 address a0 a8 a0 unused example of connected memory 16-mbit product (512 kwords 16 bits 2 banks, column 8 bits product): 1 notes: 1. l/h is a bit used in the command specificat ion; it is fixed at low or high according to the access mode. 2. bank address specification
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 242 of 1262 rej09b0437-0100 table 7.14 relationship between bsz[1:0], a3row[1:0], a3col[1:0], and address multiplex output (4)-2 setting bsz[1:0] a3row[1:0] a3col[1:0] 10 (16 bits) 01 (12 bits) 00 (8 bits) output pin of this lsi row address output column address output sdram pin function a17 a25 a17 a16 a24 a16 a15 a23 a15 unused a14 a22 * 2 a22 * 2 a13 (ba1) a13 a21 * 2 a21 * 2 a12 (ba0) specifies bank a12 a20 a12 a11 address a11 a19 l/h * 1 a10/ap specifies address/precharge a10 a18 a10 a9 a9 a17 a9 a8 a8 a16 a8 a7 a7 a15 a7 a6 a6 a14 a6 a5 a5 a13 a5 a4 a4 a12 a4 a3 a3 a11 a3 a2 a2 a10 a2 a1 a1 a9 a1 a0 address a0 a8 a0 unused example of connected memory 64-mbit product (1 mword 16 bits 4 banks, column 8 bits product): 1 notes: 1. l/h is a bit used in the command specific ation; it is fixed at l or h according to the access mode. 2. bank address specification
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 243 of 1262 rej09b0437-0100 table 7.15 relationship between bsz[1:0], a3row[1:0], a3col[1:0], and address multiplex output (5)-1 setting bsz[1:0] a3row[1:0] a3col[1:0] 10 (16 bits) 01 (12 bits) 01 (9 bits) output pin of this lsi row address output column address output sdram pin function a17 a26 a17 a16 a25 a16 a15 a24 a15 unused a14 a23 * 2 a23 * 2 a13 (ba1) a13 a22 * 2 a22 * 2 a12 (ba0) specifies bank a12 a21 a12 a11 address a11 a20 l/h * 1 a10/ap specifies address/precharge a10 a19 a10 a9 a9 a18 a9 a8 a8 a17 a8 a7 a7 a16 a7 a6 a6 a15 a6 a5 a5 a14 a5 a4 a4 a13 a4 a3 a3 a12 a3 a2 a2 a11 a2 a1 a1 a10 a1 a0 address a0 a9 a0 unused example of connected memory 128-mbit product (2 mwords 16 bits 4 banks, column 9 bits product): 1 notes: 1. l/h is a bit used in the command specificat ion; it is fixed at low or high according to the access mode. 2. bank address specification
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 244 of 1262 rej09b0437-0100 table 7.15 relationship between bsz[1:0], a3row[1:0], a3col[1:0], and address multiplex output (5)-2 setting bsz[1:0] a3row[1:0] a3col[1:0] 10 (16 bits) 01 (12 bits) 10 (10 bits) output pin of this lsi row address output column address output sdram pin function a17 a27 a17 a16 a26 a16 a15 a25 a15 unused a14 a24 * 2 a24 * 2 a13 (ba1) a13 a23 * 2 a23 * 2 a12 (ba0) specifies bank a12 a22 a12 a11 address a11 a21 l/h * 1 a10/ap specifies address/precharge a10 a20 a10 a9 a9 a19 a9 a8 a8 a18 a8 a7 a7 a17 a7 a6 a6 a16 a6 a5 a5 a15 a5 a4 a4 a14 a4 a3 a3 a13 a3 a2 a2 a12 a2 a1 a1 a11 a1 a0 address a0 a10 a0 unused example of connected memory 256-mbit product (4 mwords 16 bits 4 banks, column 10 bits product): 1 notes: 1. l/h is a bit used in the command specificat ion; it is fixed at low or high according to the access mode. 2. bank address specification
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 245 of 1262 rej09b0437-0100 table 7.16 relationship between bsz[1:0], a3row[1:0], a3col[1:0], and address multiplex output (6)-1 setting bsz[1:0] a3row[1:0] a3col[1:0] 10 (16 bits) 10 (13 bits) 01 (9 bits) output pin of this lsi row address output column address output sdram pin function a17 a26 a17 a16 a25 a16 unused a15 a24 * 2 a24 * 2 a14 (ba1) a14 a23 * 2 a23 * 2 a13 (ba0) specifies bank a13 a22 a13 a12 a12 a21 a12 a11 address a11 a20 l/h * 1 a10/ap specifies address/precharge a10 a19 a10 a9 a9 a18 a9 a8 a8 a17 a8 a7 a7 a16 a7 a6 a6 a15 a6 a5 a5 a14 a5 a4 a4 a13 a4 a3 a3 a12 a3 a2 a2 a11 a2 a1 a1 a10 a1 a0 address a0 a9 a0 unused example of connected memory 256-mbit product (4 mwords 16 bits 4 banks, column 9 bits product): 1 notes: 1. l/h is a bit used in the command specificat ion; it is fixed at low or high according to the access mode. 2. bank address specification
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 246 of 1262 rej09b0437-0100 table 7.16 relationship between bsz[1:0], a3row[1:0], a3col[1:0], and address multiplex output (6)-2 setting bsz[1:0] a3row[1:0] a3col[1:0] 10 (16 bits) 10 (13 bits) 10 (10 bits) output pin of this lsi row address output column address output sdram pin function a17 a27 a17 a16 a26 a16 unused a15 a25 * 2 a25 * 2 a14 (ba1) a14 a24 * 2 a24 * 2 a13 (ba0) specifies bank a13 a23 a13 a12 a12 a22 a12 a11 address a11 a21 l/h * 1 a10/ap specifies address/precharge a10 a20 a10 a9 a9 a19 a9 a8 a8 a18 a8 a7 a7 a17 a7 a6 a6 a16 a6 a5 a5 a15 a5 a4 a4 a14 a4 a3 a3 a13 a3 a2 a2 a12 a2 a1 a1 a11 a1 a0 address a0 a10 a0 unused example of connected memory 512-mbit product (8 mwords 16 bits 4 banks, column 10 bits product): 1 notes: 1. l/h is a bit used in the command specificat ion; it is fixed at low or high according to the access mode. 2. bank address specification
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 247 of 1262 rej09b0437-0100 (3) burst read a burst read occurs in the fo llowing cases with this lsi. ? access size in reading is larger than data bus width. ? 16-byte transfer in cache miss. ? 16-byte transfer by dmac this lsi always accesses the sdram with burst length 1. for example, read access of burst length 1 is performed consecutively 4 times to read 16-byte continuous data from the sdram that is connected to a 32-bit data bu s. this access is called the burst read with the burst number 4. table 7.17 shows the relationship between the access size and the number of bursts. table 7.17 relationship between access size and number of bursts bus width access size number of bursts 16 bits 8 bits 1 16 bits 1 32 bits 2 16 bits 8 32 bits 8 bits 1 16 bits 1 32 bits 1 16 bytes * 4
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 248 of 1262 rej09b0437-0100 figures 7.14 and 7.15 show a timing chart in burst read. in burst read, an actv command is output in the tr cycle, the read command is issued in the tc1, tc2, and tc3 cycles, the reada command is issued in the tc4 cycle, and the read data is received at the rising edge of the external clock (ckio) in the td1 to td4 cycles. the tap cy cle is used to wait fo r the completion of an auto-precharge induced by th e reada command in the sdram. in the tap cycle, a new command will not be issued to the same bank. however, access to another cs space or another bank in the same sdram space is enabled. the nu mber of tap cycles is specified by the wtrp1 and wtrp0 bits in cs3wcr. in this lsi, wait cycles can be inserted by specifying each b it in cs3wcr to connect the sdram in variable frequencies. figure 7.15 shows an example in which wait cycles are inserted. the number of cycles from the tr cycle where the actv command is output to the tc1 cycle where the read command is output can be specified using the wtrcd1 and wtrcd0 bits in cs3wcr. if the wtrcd1 and wtrcd0 bits specify one cycles or more, a trw cycle where the not command is issued is inserted between the tr cycle and tc1 cycle. the number of cycles from the tc1 cycle where the read command is out put to the td1 cycle where the read data is latched can be specified for the cs2 and cs3 spaces independently, using the a2cl1 and a2cl0 bits in cs2wcr or the a3cl1 and a3cl0 bits in cs3wcr and wtrcd0 bit in cs3wcr. the number of cycles from tc1 to td1 corresponds to the sdram cas latency. the cas latency for the sdram is normally defined as up to three cycles. however, the cas latency in this lsi can be specified as 1 to 4 cycles. this cas latenc y can be achieved by connecting a latch circuit between this lsi and the sdram. a tde cycle is an idle cycle required to transfer the read data into this lsi and occurs once for every burst read or every single read.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 249 of 1262 rej09b0437-0100 tc4 ckio a25 to a0 csn rd/ wr rasl , rasu dqmxx d31 to d0 bs (tap) dackn * 2 tr tc2 tc3 tc1 td4 tde td2 td3 td1 a12/a11 * 1 casl , casu notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.14 burst read basic timing (cas latency 1, auto pre-charge)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 250 of 1262 rej09b0437-0100 tc4 (tap) tr tc2 tc3 tc1 td4 tde td2 td3 td1 trw tw ckio a25 to a0 csn rd/ wr rasl , rasu dqmxx d31 to d0 bs dackn * 2 a12/a11 * 1 casl , casu notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.15 burst read wait speci fication timing (cas latency 2, wtrcd[1:0] = 1 cycle, auto pre-charge)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 251 of 1262 rej09b0437-0100 (4) single read a read access ends in one cycle when data exists in a cache-disabled space and the data bus width is larger than or equal to the access size. as th e sdram is set to the burst read with the burst length 1, only the required data is output. a read access that ends in one cycle is called single read. figure 7.16 shows the single read basic timing. (tap) tr tc1 tde td1 ckio a25 to a0 csn rd/ wr rasl , rasu dqmxx d31 to d0 bs dackn * 2 a12/a11 * 1 casl , casu notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.16 basic timing for single read (cas latency 1, auto pre-charge)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 252 of 1262 rej09b0437-0100 (5) burst write a burst write occurs in the fo llowing cases in this lsi. ? access size in writing is larger than data bus width. ? write-back of the cache ? 16-byte transfer in dmac this lsi always accesses sdram with burst length 1. for example, write access of burst length 1 is performed continuously 4 times to write 16-byte continuous data to the sdram that is connected to a 32-bit data bus. this access is ca lled burst write with th e burst number 4. the relationship between the access size and the number of bursts is shown in table 7.17. figure 7.17 shows a timing chart for burst writes. in burst write , an actv command is output in the tr cycle, the writ command is issued in the tc1, tc2, and tc3 cycles, and the writa command is issued to execute an auto-precharge in the tc4 cycle. in the write cycle, the write data is output simultaneously with the write command. after the write command with the auto-precharge is output, the trw1 cycle that waits fo r the auto-precharge initiation is followed by the tap cycle that waits for completion of the auto-precharge induced by the writa command in the sdram. between the trwl and the tap cycle, a new comma nd will not be issued to the same bank. however, access to another cs space or another ba nk in the same sdram space is enabled. the number of trw1 cycles is specified by the trwl1 and trwl0 bits in cs3wcr. the number of tap cycles is specified by the wtrp1 and wtrp0 bits in cs3wcr.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 253 of 1262 rej09b0437-0100 tc4 tap tr tc2 tc3 tc1 trwl ckio a25 to a0 csn rd/ wr rasl , rasu dqmxx d31 to d0 bs dackn * 2 a12/a11 * 1 casl , casu notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.17 basic timing for burst write (auto pre-charge)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 254 of 1262 rej09b0437-0100 (6) single write a write access ends in one cycle when data is wr itten in a cache-disabled space and the data bus width is larger than or equal to access size. as a single write or burst writ e with burst length 1 is set in sdram, only the required data is output. the write access that ends in one cycle is called single write. figure 7.18 shows the single write basic timing. tap tr tc1 trwl ckio a25 to a0 csn rd/ wr rasl , rasu dqmxx d31 to d0 bs dackn * 2 a12/a11 * 1 casl , casu notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.18 single write ba sic timing (auto-precharge)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 255 of 1262 rej09b0437-0100 (7) bank active the sdram bank function can be used to support high-speed access to the same row address. when the bactv bit in sdcr is 1, access is pe rformed using commands without auto-precharge (read or writ). this function is called bank-active function. this function is valid only for either the upper or lower bits of area 3. when area 3 is set to sdram, auto precharge mode must be set. when the bank-active function is used, prechargin g is not performed when the access ends. when accessing the same row address in the same bank, it is possible to is sue the read or writ command immediately, without issuing an actv command. as sdram is internally divided into several banks, it is possible to activate one ro w address in each bank. if the next access is to a different row address, a pre command is first issued to precharge the relevant bank, then when precharging is completed, the access is performed by issuing an actv command followed by a read or writ command. if this is followed by an access to a different row address, the access time will be longer because of the precharging pe rformed after the access request is issued. the number of cycles between issuance of the pr e command and the actv command is determined by the wtrp1 and wtpr0 bits in cs3wcr. in a write, when an auto-precharge is performed, a command cannot be issued to the same bank for a period of trwl + tap cycles after issuan ce of the writa command. when bank active mode is used, read or writ commands can be issued successively if the row ad dress is the same. the number of cycles can thus be reduced by trwl + tap cycles for each write. there is a limit on tras, the time for placing each bank in the active state. if there is no guarantee that there will not be a cache hit and another row address will be accessed within the period in which this value is maintained by program executio n, it is necessary to set auto-refresh and set the refresh cycle to no more than the maximum value of tras. a burst read cycle without auto-precharge is shown in figure 7.19, a burst read cycle for the same row address in figure 7.20, and a burst read cy cle for different row addresses in figure 7.21. similarly, a burst write cycle without auto-prechar ge is shown in figure 7.22, a burst write cycle for the same row address in figure 7.23, and a burst write cycle for different row addresses in figure 7.24. in figure 7.20, a tnop cycle in which no operation is performed is inserted be fore the tc cycle that issues the read command. the tnop cycle is inse rted to acquire two cycles of cas latency for the dqmxx signal that specifies the read byte in the data read from the sdram. if the cas latency is specified as two cycles or more, the tnop cycle is not inserted because the two cycles of latency can be acquired even if the dqmxx signal is asserted after the tc cycle.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 256 of 1262 rej09b0437-0100 when bank active mode is set, if only access cycles to the respective banks in the area 3 space are considered, as long as access cycles to the same row address continue, the operation starts with the cycle in figure 7.19 or 7.22, fo llowed by repetition of the cycle in figure 7.20 or 7.23. an access to a different area during this time ha s no effect. if there is an access to a different row address in the bank active state, after this is de tected the bus cycle in figure 7.21 or 7.24 is executed instead of that in figure 7.20 or 7.23. in bank active mo de, too, all banks become inactive after a refresh cycle or after the bus is released as the result of bus arbitration. tc4 ckio a25 to a0 csn rd/ wr ras dqmxx d31 to d0 bs dackn * 2 tr tc2 tc3 tc1 td4 td2 td3 td1 tde a12/a11 * 1 cas notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.19 burst read timing (ba nk active, different bank, cas latency 1)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 257 of 1262 rej09b0437-0100 tc4 ckio a25 to a0 csn rd/ wr ras dqmxx d31 to d0 bs dackn * 2 tc2 tc3 tc1 tnop td4 tde td2 td3 td1 a12/a11 * 1 cas notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.20 burst read timing (bank acti ve, same row addresses in the same bank, cas latency 1)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 258 of 1262 rej09b0437-0100 tc4 ckio a25 to a0 csn rd/ wr d31 to d0 bs tpw dackn * 2 tp tc2 tc3 tc1 td4 td2 td3 td1 a12/a11 * 1 tde tr ras dqmxx cas notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.21 burst read timing (bank acti ve, different row addresse s in the same bank, cas latency 1)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 259 of 1262 rej09b0437-0100 ckio a25 to a0 csn rd/ wr d31 to d0 bs dackn * 2 tr tc1 a12/a11 * 1 ras dqmxx cas notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.22 single write timi ng (bank active, different bank)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 260 of 1262 rej09b0437-0100 ckio a25 to a0 csn rd/ wr d31 to d0 bs dackn * 2 tnop tc1 a12/a11 * 1 ras dqmxx cas notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.23 single write timing (bank ac tive, same row addresses in the same bank)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 261 of 1262 rej09b0437-0100 ckio a25 to a0 csn rd/ wr d31 to d0 bs tpw dackn * 2 tp tc1 a12/a11 * 1 tr ras dqmxx cas notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.24 single write timing (bank active, different row addresses in the same bank)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 262 of 1262 rej09b0437-0100 (8) refreshing this lsi has a function for controlling sdram refreshing. auto-refreshing can be performed by clearing the rmode bit to 0 and setting the rfsh bit to 1 in sdcr. a continuous refreshing can be performed by setting the rrc2 to rrc0 bits in rtcsr. if sd ram is not accessed for a long period, self-refresh mode, in which the power consumption for data retention is low, can be activated by setting both the rmode bit and the rfsh bit to 1. (a) auto-refreshing refreshing is performed at intervals determined by the input clock selected by bits cks2 to cks0 in rtcsr, and the value set by in rtcor. the value of bits cks2 to cks0 in rtcor should be set so as to satisfy the refresh interval stipulation for the sdram used. first make the settings for rtcor, rtcnt, and the rmode and rfsh b its in sdcr, then make the cks2 to cks0 and rrc2 to rrc0 settings. when the clock is selected by bits cks2 to cks0, rtcnt starts counting up from the value at that time. the rt cnt value is constantly compared with the rtcor value, and if the two values are the same , a refresh request is generated and an auto- refresh is performed for the numb er of times specified by the rrc2 to rrc0. at the same time, rtcnt is cleared to zero and the count-up is restarted. figure 7.25 shows the auto-refresh cycle timin g. after starting, the auto refreshing, pall command is issued in the tp cycle to make all the banks to pre-charged state from active state when some bank is being pre-charged. then ref command is issued in the trr cycle after inserting idle cycles of which number is spec ified by the wtrp1 and wtrp0 bits in cs3wcr. a new command is not issued for the duration of th e number of cycles speci fied by the wtrc1 and wtrc0 bits in cs3wcr after the trr cycle. the wtrc1 and wtrc0 bits must be set so as to satisfy the sdram refreshing cycle time stipulation (trc). an idle cycle is inserted between the tp cycle and trr cycle when the setting value of the wtrp1 and wtrp0 bits in cs3wcr is longer than or equal to 1 cycle.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 263 of 1262 rej09b0437-0100 ckio a25 to a0 csn rd/ wr d31 to d0 bs tpw dackn * 2 tp trr a12/a11 * 1 trc trc trc hi-z ras dqmxx cas notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.25 auto-refresh timing
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 264 of 1262 rej09b0437-0100 (b) self-refreshing self-refresh mode in which the refresh timing and refresh addresses ar e generated within the sdram. self-refreshing is activated by setting both the rmode bit and the rfsh bit in sdcr to 1. after starting the self-refreshing, pall comm and is issued in tp cycle after the completion of the pre-charging bank. a self command is then issued after inserting idle cycles of which number is specified by the wtrp1 and wtrp0 bits in cs3wsr. sdram cannot be accessed while in the self-refresh state. self-refresh mode is cleared by clearing the rmode bit to 0. after self-refresh mode has been cleared, command issu ance is disabled for the number of cycles specified by the wtrc1 and wtrc0 bits in cs3wcr. self-refresh timing is shown in figure 7.26. settings must be made so that self-refresh clearing and data retention are performed correctly, and auto-re freshing is performed at the correct intervals. when self-refreshing is activated from the state in which auto-refreshing is set, or when exiting standby mode other than through a power-on reset, auto-refreshing is restarted if the rfsh bit is set to 1 and the rmode bit is cleared to 0 when self-refresh mode is cl eared. if the transition from clearing of self-refresh mo de to the start of auto-refreshing takes time, this time should be taken into consideration when setting the initial value of rtcnt. making the rtcnt value 1 less than the rtcor value will enable refreshing to be started immediately. after self-refreshing has been set, the self-refresh state continues even if the chip standby state is entered using the lsi standby function, and is maintained even after recovery from standby mode due to an interrupt. note that the necessary signals such as cke must be driven even in standby state by setting the hizcnt bit in cmncr to 1. in case of a power-on reset, the bus state contro ller's registers are initialized, and therefore the self-refresh state is cleared.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 265 of 1262 rej09b0437-0100 tpw tp trr trc trc hi-z trc ckio cke a25 to a0 csn rd/ wr ras dqmxx d31 to d0 bs dackn * 2 a12/a11 * 1 cas notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.26 self-refresh timing (9) relationship between refresh requests and bus cycles if a refresh request occurs during bus cycle execution, the refresh cycle must wait for the bus cycle to be completed. if a new refresh request occurs while waiting for the previous refresh request, the previous refresh request is deleted. to refresh correctly, a bus cy cle longer than the refr esh interval must be prevented from occurring.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 266 of 1262 rej09b0437-0100 (10) power-down mode if the pdown bit in sdcr is set to 1, the sdra m is placed in power-down mode by bringing the cke signal to the low level in the non-acce ss cycle. this power-down mode can effectively lower the power consump tion in the non-access cycle. howe ver, please note that if an access occurs in power-down mode, a cycl e of overhead occurs because a cycle is needed to assert the cke in order to cancel the power-down mode. figure 7.27 shows the access timing in power-down mode. ckio a25 to a0 csn rd/ wr d31 to d0 bs tnop dackn * 2 power-down tr a12/a11 * 1 tc1 td1 tde tap power-down cke ras dqmxx cas notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.27 power-do wn mode access timing
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 267 of 1262 rej09b0437-0100 (11) power-on sequence in order to use sdram, mode setting must first be made for sdram after waiting for 100 s or a longer period after powering on. this 100- s or longer period should be obtained by a power-on reset generating circuit or software. to perform sdram initialization correctly, the bus state controller registers must first be set, followed by a write to the sdram mode register. in sdram mode register setting, the address signal value at that time is latched by a combination of the csn , ras , cas , and rd/ wr signals. if the value to be set is x, the bus state controller provides for value x to be written to the sdram mode register by performing a write to address h'fffc5000 + x for area 3 sdram. in this operation the data is ignore d, but the mode write is perform ed as a byte-size access. to set burst read/single write, cas latency 2 to 3, wrap type = sequential, and burst length 1 supported by the lsi, arbitrary data is wr itten in a byte-size access to the ad dresses shown in table 7.18. in this time 0 is output at the external address pins of a12 or later. table 7.18 access address in sdram mode register write ? setting for area 3 burst read/single write (burst length 1): data bus width cas latency access address external address pin 16 bits 2 h'fffc5440 h'0000440 3 h'fffc5460 h'0000460 32 bits 2 h'fffc5880 h'0000880 3 h'fffc58c0 h'00008c0 burst read/burst write (burst length 1): data bus width cas latency access address external address pin 16 bits 2 h'fffc5040 h'0000040 3 h'fffc5060 h'0000060 32 bits 2 h'fffc5080 h'0000080 3 h'fffc50c0 h'00000c0
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 268 of 1262 rej09b0437-0100 mode register setting timing is shown in figure 7.28. a pall command (all bank pre-charge command) is firstly issued. a re f command (auto refresh command) is then issued 8 times. an mrs command (mode register write command) is finally issued. idle cycles, of which number is specified by the wtrp1 and wtrp0 bits in cs3wcr, are inserted between the pall and the first ref. idle cycles, of which number is sp ecified by the wtrc1 and wtrc0 bits in cs3wcr, are inserted between ref and ref, and between the 8th ref and mrs. idle cycles, of which number is one or more, are in serted between the mrs and a command to be issued next. it is necessary to keep idle time of certain cy cles for sdram before issuing pall command after power-on. refer to the manual of the sdram for the idle time to be needed. when the pulse width of the reset signal is longer than the idle time, mode register setting can be started immediately after the reset, but care should be ta ken when the pulse width of the reset signal is shorter than the idle time. tpw tp trr trc trc tmw hi-z tnop trc trr trc ref ref mrs pall ckio a25 to a0 csn rd/ wr rasl , rasu dqmxx d31 to d0 bs dackn * 2 a12/a11 * 1 casl , casu notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.28 sdram mode write timing (based on jedec)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 269 of 1262 rej09b0437-0100 (12) low-power sdram the low-power sdram can be accessed using the same protocol as the normal sdram. the differences between the low-power sdram and normal sdram are that partial refresh takes place that puts only a part of the sdram in the self-refresh state during the self-refresh function, and that power consumption is low during refresh under user conditions such as the operating temperature. the partial refresh is effectiv e in systems in which th ere is data in a work area other than the specific area can be lost without severe repercussions. the low-power sdram supports the extension mode register (emrs) in addition to the mode registers as the normal sdram. this lsi supports issuing of the emrs command. the emrs command is issued accor ding to the conditions specified in table below. for example, if data h'0yyyyyyy is written to address h'ff fc5xx0 in longword, th e commands are issued to the cs3 space in the follo wing sequence: pall -> ref 8 -> mrs -> emrs. in this case, the mrs and emrs issue addresses are h'0000xx0 and h'yyyyyyy, respectively. if data h'1yyyyyyy is written to address h'fffc5xx0 in longword, the commands are issued to the cs3 space in the following sequence: pall -> mrs -> emrs. table 7.19 output addresses when emrs command is issued command to be issued access address access data write access size mrs command issue address emrs command issue address cs3 mrs h'fffc5xx0 h' ******** 16 bits h'0000xx0 ? cs3 mrs + emrs (with refresh) h'fffc5xx0 h'0yyyyyyy 32 bits h'0000xx0 h'yyyyyyy cs3 mrs + emrs (without refresh) h'fffc5xx0 h'1yyyyyyy 32 bits h'0000xx0 h'yyyyyyy
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 270 of 1262 rej09b0437-0100 ckio a25 to a0 csn rd/ wr ras dqmxx d31 to d0 bs tpw dackn * 4 tp trr a12/a11 * 3 ba1 * 1 ba0 * 2 cas trc trc tmw hi-z tnop trc trr trc ref ref mrs temw tnop emrs pall notes: 1. address pin to be connected to pin ba1 of sdram. 2. address pin to be connected to pin ba0 of sdram. 3. address pin to be connected to pin a10 of sdram. 4. the waveform for dackn is when active low is specified. figure 7.29 emrs command issue timing
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 271 of 1262 rej09b0437-0100 ? deep power-down mode the low-power sdram supports the deep power-down mode as a low-power consumption mode. in the partial self-refresh function, self-refresh is performed on a specific area. in the deep power-down mode, self-refresh will not be performed on any memory area. this mode is effective in systems where a ll of the system memory area s are used as work areas. if the rmode bit in the sdcr is set to 1 while the deep and rfsh bits in the sdcr are set to 1, the low-power sdram enters the deep power-down mode. if the rmode bit is cleared to 0, the cke signal is pulled high to cancel the deep power-down mode. before executing an access after returning from the deep power-down mode, the power-up sequence must be re-executed. tpw tp trr trc trc hi-z trc ckio cke a25 to a0 csn rd/ wr ras dqmxx d31 to d0 bs dackn * 2 a12/a11 * 1 cas notes: 1. address pin to be connected to pin a10 of sdram. 2. the waveform for dackn is when active low is specified. figure 7.30 deep power-do wn mode transition timing
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 272 of 1262 rej09b0437-0100 7.5.6 sram interface with byte selection the sram interface with byte selection is for access to an sram which has a byte-selection pin ( wen ). this interface has 16-bit data pins and accesses srams having upper and lower byte selection pins, such as ub and lb. when the bas bit in csnwcr is cleared to 0 (in itial value), the write access timing of the sram interface with byte selection is the same as that for the normal space in terface. while in read access of a byte-selection sram interface, the byte-selection signal is output from the wen pin, which is different from that for the normal sp ace interface. the basic access timing is shown in figure 7.31. in write access, data is written to the memory according to the timing of the byte- selection pin ( wen ). for details, please refer to the data sheet for the corresponding memory. if the bas bit in csnwcr is set to 1, the wen pin and rd/ wr pin timings change. figure 7.32 shows the basic access timing. in write access, data is written to the me mory according to the timing of the write enable pin (rd/ wr ). the data hold timing from rd/ wr negation to data write must be acquired by setting the hw1 and hw0 bits in csnwcr. figure 7.33 shows the access timing when a software wait is specified.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 273 of 1262 rej09b0437-0100 ckio a25 to a0 csn wen rd/ wr rd rd d31 to d0 d31 to d0 rd/ wr bs dackn * read write note: * the waveform for dackn is when active low is specified. t1 t2 high figure 7.31 basic access timing for sr am with byte selection (bas = 0)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 274 of 1262 rej09b0437-0100 t1 t2 high ckio a25 to a0 csn wen rd/ wr rd rd d31 to d0 d31 to d0 rd/ wr bs dackn * read write note: * the waveform for dackn is when active low is specified. figure 7.32 basic access timing for sram with byte selection (bas = 1)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 275 of 1262 rej09b0437-0100 t2 tf th t1 tw high ckio a25 to a0 csn wen rd/ wr rd rd d31 to d0 d31 to d0 rd/ wr bs dackn * read write note: * the waveform for dackn is when active low is specified. figure 7.33 wait timing for sram with byte selection (bas = 1) (sw[1:0] = 01, wr[3:0] = 0001, hw[1:0] = 01)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 276 of 1262 rej09b0437-0100 a15 a0 cs oe we i/o15 i/o0 ub lb . . . . . . . . . a17 a2 csn rd rd/ wr d31 d16 we3 we2 d15 d0 we1 we0 this lsi . . . a15 a0 cs oe we i/o15 i/o0 ub lb . . . . . . . . . 64k 16-bit sram figure 7.34 example of connection with 32- bit data-width sram with byte selection this lsi a16 . . . a1 csn rd rd/ wr d15 . . . d0 we1 we0 a15 . . . a0 cs oe we i/o 15 . . . i/o 0 ub lb 64k 16-bit sram figure 7.35 example of connection with 16- bit data-width sram with byte selection
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 277 of 1262 rej09b0437-0100 7.5.7 pcmcia interface with this lsi, areas 5 and 6 can be used for th e ic memory card and i/o card interface defined in the jeida specifications version 4.2 (pcmcia2.1 rev. 2.1) by specifying bits type[2:0] in csnbcr (n = 5 and 6) to b'101. in addition, the bits sa[1:0] in csnwcr (n = 5 and 6) assign the upper or lower 32 mbytes of each area to ic memory card or i/o card interface. for example, if the bits sa1 and sa0 in cs5wcr are set to 1 and cleared to 0, respectively, the upper 32 mbytes of area 5 are used for ic memory card interface and the lower 32 mbytes are used for i/o card interface. when the pcmcia interface is used, the bus size must be specified as 8 bits or 16 bits using the bits bsz[1:0] in cs5bcr or cs6bcr. figure 7.36 shows an example of connection between this lsi and a pcmcia card. to enable hot swapping (insertion and removal of the pcmcia card with the system power turned on), tri-state buffers must be connected between the lsi and the pcmcia card. in the jeida and pcmcia standards, operation in big endian mode is not clearly defined. consequently, the provided pcmcia interface in big endian mode is available only for this lsi.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 278 of 1262 rej09b0437-0100 this lsi pc card (memory or i/o) a25 to a0 d7 to d0 ce1 ce2 oe we / pgm iord iowr reg a25 to a0 d7 to d0 d15 to d8 rd/ wr cs5b / ce1a ce2a rd we1 / we we2 / iciord we3 / iciowr reg (output port) wait iois16 g g dir g g dir d15 to d8 wait iois16 cd1, cd2 card detector figure 7.36 example of pcmcia interface connection
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 279 of 1262 rej09b0437-0100 (1) basic timing for memory card interface figure 7.37 shows the basic timi ng of the pcmcia ic memory car d interface. when areas 5 and 6 are specified as the pcmcia interface, the bu s is accessed with the ic memory card interface according to the sa[1:0 ] bit settings in cs5wcr and cs6wcr. if the external bus frequency (ckio) increases, the setup times and hold times for the address pi ns (a25 to a0), card enable signals ( ce1a , ce2a , ce1b , ce2b ), and write data (d15 to d0) to the rd and we signals become insufficient. to prevent this error, th is lsi enables the setup times and hold times for areas 5 and 6 to be specified independently, using cs5wcr and cs6wcr. in the pcmcia interface, as in the normal spa ce interface, a software wait or hardware wait using the wait pin can be inserted. figure 7.38 shows th e pcmcia memory bus wait timing. tpcm1w ckio a25 to a0 cexx rd/ wr rd d15 to d0 we d15 to d0 bs read write tpcm2 tpcm1 tpcm1w tpcm1w figure 7.37 basic access timing for pcmcia memory card interface
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 280 of 1262 rej09b0437-0100 tpcm1w ckio a25 to a0 cexx rd/ wr rd d15 to d0 we d15 to d0 bs read write tpcm2 tpcm0 tpcm1 tpcm1w tpcm0w tpcm2w tpcm1w tpcm1w wait figure 7.38 wait timing for pcmcia memory card interface (ted[3:0] = b'0010, pcw[3:0] = b'0000, teh[3:0] = b'0001, hardware wait = 1) a port is used to generate the reg signal that switches between the common memory and attribute memory. as shown in th e example in figure 7.39, when the total memory space necessary for the common memory and attribute memory is 32 mbytes or less, pin a24 can be used as the reg signal to allocate a 16-mbyte common memory space and a 16-mbyte attribute memory space.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 281 of 1262 rej09b0437-0100 in case of 32mbyts capacity ( reg = i/o port is used) area 5: h'14000000 attribute memory/common memory i/o space attribute memory/common memory i/o space area 5: h'16000000 area 6: h'18000000 area 6: h'1a000000 in case of 16mbyts capacity ( reg = a24 is used) area 5: h'14000000 attribute memory i/ospace area 5: h'15000000 area 5: h'16000000 h'17000000 area 6: h'18000000 area 6: h'19000000 area 6: h'1a000000 h'1b000000 common memory attribute memory i/ospace common memory figure 7.39 example of pcmcia space allocation (cs5wcr.sa[1:0] = b'10, cs6wcr.sa[1:0] = b'10)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 282 of 1262 rej09b0437-0100 (2) basic timing for i/o card interface figures 7.40 and 7.41 show the basic timing for the pcmcia i/o card interface. when accessing an i/o card through the pcmcia interface, be sure to access the space as cache- disabled. switching between i/o card and ic memory card in terfaces in the respective address spaces is accomplished by the sa [1:0] bit settings in cs5wcr and cs6wcr. the iois16 pin can be used for dynamic adjustment of the width of the i/o bus in access to an i/o card via the pcmcia interface when little endian mode has been selected. when the bus width of area 5 or 6 is set to 16 bits and the iois16 signal is driven high duri ng a cycle of word-unit access to the i/o card bus, the bus width will be recognized as 8 bits and only 8 bits of data will be accessed during the current cycle of the i/o card bu s. operation will automa tically continue with access to the remaining 8 bits of data. the iois16 signal is sampled on falling edges of the ckio in tpci0 as well as all tpci0w cycles for which the ted3 to ted0 bits are set to 1.5 cycles or more, and the ce2a and ce2b signals are updated after 1.5 cycles of th e ckio signal from the sampling point of tpci0. ensure that the iois16 signal is defined at all sampling points and does not change along the way. set the ted3 to ted0 bits to satisfy the requirement of the pc card in use with regard to setup timing from iciord or iciowr to ce1 or ce2 . the basic waveforms for dynamic bus-size adjustment are shown in figure 7.41. since the iois16 signal is not supported in big endian mode, the iois16 signal should be fixed to the low level when big endian mode has been selected.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 283 of 1262 rej09b0437-0100 tpci1w ckio a25 to a0 cexx rd/ wr iciord d15 to d0 iciowr d15 to d0 bs read write tpci2 tpci1 tpci1w tpci1w figure 7.40 basic access timing for pcmcia i/o card interface tpci1w ckio a25 to a0 ce1x rd/ wr iciord d15 to d0 iciowr iois16 d15 to d0 bs read write tpci2 ce2x tpci0 tpci1 tpci1w tpci0w tpci2w tpci1w tpci1w wait tpci1w tpci2 tpci0 tpci1 tpci1w tpci0w tpci2w tpci1w tpci1w figure 7.41 dynamic bus-si ze adjustment timing for pc mcia i/o card interface (ted[3:0] = b'0010, pcw[3:0] = b'0000, teh[3:0] = b'0001, hardware wait = 1)
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 284 of 1262 rej09b0437-0100 7.5.8 wait between access cycles as the operating frequency of lsis becomes higher, the off-operation of the data buffer often collides with the next data acce ss when the read operation from devices with slow access speed is completed. as a result of these collisions, the reliability of the device is low and malfunctions may occur. a function that avoids data collisions by inserting idle (wait) cycles between continuous access cycles has been newly added. the number of wait cycles be tween access cycles can be set by the wm bit in csnwcr, bits iww2 to iww0, iwrwd2 to iwrwd0, iwrw s2 to iwrws0, iwrrd2 to iwrrd0, and iwrrs2 to iwrrs 0 in csnbcr, and bits dm aiw2 to dmaiw0 and dmaiwa in cmncr. the conditions for setting the idle cycles between access cycles are shown below. 1. continuous acce ss cycles are write-r ead or write-write 2. continuous access cycles are read-write for different spaces 3. continuous access cycles are read-write for the same space 4. continuous access cycles are read-read for different spaces 5. continuous access cycles are read-read for the same space 6. data output from an external device caused by dma single address transfer is followed by data output from another device that includes this lsi (dmaiwa = 0) 7. data output from an external device caused by dma single address transfer is followed by any type of access (dmaiwa = 1) for the specification of the number of idle cycles between access cycles described above, refer to the description of each register. besides the idle cycles between access cycles specified by the regi sters, idle cycles must be inserted to interface with the in ternal bus or to obtain the mini mum pulse width for a multiplexed pin ( wen ). the following gives detailed information about the idle cycles and describes how to estimate the number of idle cycles. the number of idle cycles on the ex ternal bus from csn negation to csn or csm assertion is described below. here, csn and csm also include ce2a and ce2b for pcmcia. there are eight conditions that determine the number of idle cycles on the external bus as shown in table 7.20. the effects of these conditions are shown in figure 7.42.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 285 of 1262 rej09b0437-0100 table 7.20 conditions for determ ining number of idle cycles no. condition description range note [1] dmaiw[2:0] in cmncr these bits specify the number of idle cycles for dma single address transfer. this condition is effective only for single address transfer and generates idle cycles after the access is completed. 0 to 12 when 0 is specified for the number of idle cycles, the dack signal may be asserted continuously. this causes a discrepancy between the number of cycles detected by the device with dack and the dmac transfer count, resulting in a malfunction. [2] iw***[2:0] in csnbcr these bits specify the number of idle cycles for access other than single address transfer. the number of idle cycles can be specified independently for each combination of the previous and next cycles. for example, in the case where reading cs3 space followed by reading other cs space, the bits iwrrd[2:0] in cs3bcr should be set to b'100 to specify six or more idle cycles. this condition is effective only for access cycles other than single address transfer and generates idle cycles after the access is completed. 0 to 12 do not set 0 for the number of idle cycles between memory types which are not allowed to be accessed successively. [3] sdram-related bits in csnwcr these bits specify precharge completion and startup wait cycles and idle cycles between commands for sdram access. this condition is effective only for sdram access and generates idle cycles after the access is completed 0 to 3 specify these bits in accordance with the specification of the target sdram. [4] wm in csnwcr this bit enables or disables external wait pin input for the memory types other than sdram. when this bit is cleared to 0 (external wait enabled), one idle cycle is inserted to check the external wait pin input after the access is completed. when this bit is set to 1 (disabled), no idle cycle is generated. 0 or 1
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 286 of 1262 rej09b0437-0100 no. condition description range note [5] read data transfer cycle one idle cycle is inserted after a read access is completed. this idle cycle is not generated for the first or middle cycles in divided access cycles. this is neither generated when the hm[1:0] bits in csnwcr are not b'00. 0 or 1 one idle cycle is always generated after a read cycle with sdram or pcmcia interface. [6] internal bus idle cycles, etc. external bus access requests from the cpu or dmac and their results are passed through the internal bus. the external bus enters idle state during internal bus idle cycles or while a bus other than the external bus is being accessed. this condition is not effective for divided access cycles, which are generated by the bsc when the access size is larger than the external data bus width. 0 or larger the number of internal bus idle cycles may not become 0 depending on the i :b clock ratio. tables 7.21 and 7.22 show the relationship between the clock ratio and the minimum number of internal bus idle cycles. [7] write data wait cycles during write access, a write cycle is executed on the external bus only after the write data becomes ready. this write data wait period generates idle cycles before the write cycle. note that when the previous cycle is a write cycle and the internal bus idle cycles are shorter than the previous write cycle, write data can be prepared in parallel with the pr evious write cycle and therefore, no idle cycle is generated (write buffer effect). 0 or 1 for write write or write read access cycles, successive access cycles without idle cycles are frequently available due to the write buffer effect described in the left column. if successive access cycles without idle cycles are not allowed, specify the minimum number of idle cycles between access cycles through csnbcr. [8] idle cycles between different memory types to ensure the minimum pulse width on the signal-multiplexed pins, idle cycles may be inserted before access after memory types are switched. for some memory types, idle cycles are inserted even when memory types are not switched. 0 to 2.5 the number of idle cycles depends on the target memory types. see table 7.23.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 287 of 1262 rej09b0437-0100 in the above conditions, a total of four conditions, that is, condition [1] or [2] (either one is effective), condition [3] or [4] (either one is effec tive), a set of conditions [5] to [7] (these are generated successively, and therefore the sum of them should be taken as on e set of idle cycles), and condition [8] are generated at the same time. the maximum number of idle cycles among these four conditions become the number of idle cycles on the external bus. to ensure the minimum idle cycles, be sure to make register settings for condition [1] or [2]. ckio csn previous access external bus idle cycles idle cycle after access either one of them is effective [1] dmaiw[2:0] setting in cmncr [2] iww[2:0] setting in csnbcr iwrwd[2:0] setting in csnbcr iwrws[2:0] setting in csnbcr iwrrd[2:0] setting in csnbcr iwrrs[2:0] setting in csnbcr [3] wtrp[1:0] setting in csnwcr trwl[1:0] setting in csnwcr wtrc[1:0] setting in csnwcr [4] wm setting in csnwcr [6] internal bus idle cycles, etc. [8] idle cycles between different memory types [5] read data transfer [7] write data wait idle cycle before access next access condition [1] or [2] a total of four conditions (condition [1] or [2], condition [3] or [4], a set of conditions [5] to [7], and condition [8]) generate idle cycle at the same time. accordingly, the maximum number of cycles among these four conditions become the number of idle cycles. note: condition [8] condition [3] or [4] set of conditions [5] to [7] either one of them is effective figure 7.42 idle cycle conditions
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 288 of 1262 rej09b0437-0100 table 7.21 minimum number of idle cycl es on internal bus (cpu operation) clock ratio (i :b ) cpu operation 8:1 6:1 4:1 3:1 2:1 1:1 write write 1 1 2 2 2 3 write read 0 0 0 0 0 1 read write 1 1 2 2 2 3 read read 0 0 0 0 0 1 table 7.22 minimum number of idle cycl es on internal bu s (dmac operation) transfer mode dmac operation dual address single address write write 0 2 write read 0 or 2 0 read write 0 0 read read 0 2 notes: 1. the write write and read read columns in dual address transfer indicate the cycles in the divided access cycles. 2. for the write read cycles in dual address transfer, 0 means different channels are activated successively and 2 means when th e same channel is activated successively. 3. the write read and read write columns in single address transfer indicate the case when different channels are activated successi vely. the "write" means transfer from a device with dack to external memory and the "read" means transfer from external memory to a device with dack. table 7.23 number of idle cycles inserted between access cycles to different memory types next cycle previous cycle sram byte sram (bas = 0) byte sram (bas = 1) sdram pcmcia sram 0 0 1 1 0 byte sram (bas = 0) 0 0 1 1 0 byte sram (bas = 1) 1 1 0 0 1 sdram 1 1 0 0 1 pcmcia 0 0 1 1 0
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 289 of 1262 rej09b0437-0100 figure 7.43 shows sample estima tion of idle cycles between access cycles. in the actual operation, the idle cycles may become shorter than the estim ated value due to the wr ite buffer effect or may become longer due to internal bus idle cycles caused by stalli ng in the pipeline due to cpu instruction execution or cpu register conflicts. please consider these errors when estimating the idle cycles. sample estimation of the number of idle clock cycles (states) between cycles of bus access  condition item note r rr ww ww r 0000 0000 1100 0220 0100 1420 0000 1420 1 (1)/(2) (3)/(4) (5) (6) (7) (5)+(6)+(7) (8) estimated number of idle cycles actual number of idle cycles since csnbcr is set to 0 when the wm bit is set to 1 generated after the read cycle see the description for if:bf= 4:1 in table 7.21. the effect of the write buffer is that idle cycles are not generated the second time. due to sram sram maximum value among (1)/(2), (3)/(4), (5)+(6)+(7), and (8) the mismatch in the case of w r is because the estimate of the number of idle cycles for item (6) was zero. since a loop-decision instruction is actually executed here, an idle cycle is generated internally. 421 0 is specified as the number of idle cycles between cs5bcr and cs6bcr. wm bit in cs5wcr and cs6wcr = 1 (external wait_ pin disabled) hw[1:0] = 00 (no delay of cs negation) if:bf= 4:1 no other processing proceeds during the transfer. cs5 and cs6 are connected to sram for access in 32-bit units by a 32-bit-wide bus. we consider cpu access for the transfer of data from the cs5 to the cs6 space. for this transfer, the sequence read from cs5 read from cs5 write to cs6 write to cs6 ... is repeated. the items that decide the number of idle cycles are estimated for the different transitions on between bus cycles. r indicates reading and w indicates writing in the table below. figure 7.43 comparison between esti mated idle cycles and actual value
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 290 of 1262 rej09b0437-0100 7.5.9 others (1) reset the bus state controller (bsc) can be initialized co mpletely only at power-on reset. at power-on reset, all signals are negated and data output buffe rs are turned off regardless of the bus cycle state after the internal reset is synchronized with the in ternal clock. all control registers are initialized. in standby, sleep, and manual reset, control regist ers of the bus state contro ller are not initialized. at manual reset, only the current bus cycle be ing executed is completed. since the rtcnt continues counting up during manual reset signal assertion, a refresh request occurs to initiate the refresh cycle. (2) access from the side of the lsi internal bus master there are three types of lsi internal buses: a cpu bus, internal bus, and peripheral bus. the cpu and cache memory are connected to the cpu bus. in ternal bus masters other than the cpu and bus state controller are connected to the internal bus. low-speed peri pheral modules are connected to the peripheral bus. internal me mories other than the cache memory are connected bidirectionally to the cpu bus and internal bu s. access from the cpu bus to th e internal bus is enabled but access from the internal bus to the cache bus is disabled. this gives rise to the following problems. on-chip bus masters such as dm ac other than the cpu can access internal memory other than the cache memory but cannot access the cache memory. if an on-chip bus master other than the cpu writes data to an external memory other than the cache, the contents of the external memory may differ from that of the cach e memory. to prevent this problem, if the external memory whose contents is cached is written by an on-chip bus master other than the cpu, the corresponding cache memory should be purged by software. in a cache-enabled space, if the cpu initiates read access, the cache is searched . if the cache stores data, the cpu latches the data and completes the read access. if the cache do es not store data, the cpu performs four contiguous longword read cycles to perform cache fill operations via the internal bus. if a cache miss occurs in byte or word operand access or at a branch to an odd word boundary (4n + 2), the cpu perfor ms four contiguous longword access cycles to perform a cache fill operation on the external interface. for a cache-disabled space, the cpu performs access according to the actual access addresses. for an inst ruction fetch to an even word boundary (4n), the cpu performs longword access. for an instruction fetch to an odd word boundary (4n + 2), the cpu performs word access. for a read cycle of an on-chip pe ripheral module, the cycle is init iated through the internal bus and peripheral bus. the read data is sent to the cpu via the peripheral bus, internal bus, and cpu bus.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 291 of 1262 rej09b0437-0100 in a write cycle for the cache-enabled space, th e write cycle operation differs according to the cache write methods. in write-back mode, the cache is first searched. if data is detected at the address corresponding to the cache, the data is then re-wr itten to the cache. in the actual me mory, data will not be re-written until data in the corresponding address is re-wr itten. if data is not detected at the address corresponding to the cache, the cache is modified. in this case, data to be modified is first saved to the internal buffer, 16-byte data including the data corresponding to the address is then read, and data in the corresponding access of the cache is finally modified. following these operations, a write-back cycle for the saved 16-byte data is executed. in write-through mode, the cache is first searched . if data is detected at the address corresponding to the cache, the data is re-writt en to the cache simultaneously with the actual write via the internal bus. if data is not detected at the address corres ponding to the cache, the cache is not modified but an actual write is performed via the internal bus. since the bus state controller (bsc ) incorporates a one-stage write buffer, the bsc can execute an access via the internal bus before the previous exte rnal bus cycle is comple ted in a write cycle. if the on-chip module is read or written after the exte rnal low-speed memory is written, the on-chip module can be accessed before the completion of th e external low-speed me mory write cycle. in read cycles, the cpu is placed in the wait st ate until read operation has been completed. to continue the process after the data write to the device has been completed, perform a dummy read to the same address to check for completion of the write before the next process to be executed. the write buffer of the bsc functions in the sa me way for an access by a bus master other than the cpu such as the dmac. accord ingly, to perform dual address dma transfers, the next read cycle is initiated before the prev ious write cycle is completed. note, however, that if both the dma source and destination addresses exist in ex ternal memory space, the next write cycle will not be initiated until the previous write cycle is completed. changing the registers in the bsc while the write buffer is operating may disrupt correct write access. therefore, do not change the registers in the bsc immediately after a write access. if this change becomes necessary, do it after executing a dummy read of the write data. in this lsi, the priority level applicable when th ere is a request for bus ma stership for the internal bus from any of the internal bus masters excluding the cpu (that is, a-dmac (including f- dmac), e-dmac, and dmac) can be set in the register. when changing the priority level, rewrite the register after making sure that none of the a-dmac (including f-dmac), e-dmac, and dmac is started.
section 7 bus state controller (bsc) rev. 1.00 nov. 14, 2007 page 292 of 1262 rej09b0437-0100 (3) on-chip peripheral module access to access an on-chip module register, two or more periphe ral module clock (p ) cycles are required. care must be taken in system design. when the cpu writes data to the internal peri pheral registers, the cpu performs the succeeding instructions without waiting for the completion of writing to registers. for example, a case is described here in which the system is transferring to the software standby mode for power savings. to make this transition, the sleep instruction must be performed after setting the stby bit in the stbcr register to 1. however a dummy read of the stbcr register is required before executin g the sleep instruction. if a dummy read is omitted, the cpu executes the sleep instruction before the stby bit is set to 1, thus the system enters sleep mode not software standby mode. a dummy read of the stbcr register is indispensable to complete writing to the stby bit. to reflect the change by internal peripheral registers while perfor ming the succeeding instructions, execute a dummy read of registers to which write instruction is given and then perform the succeeding instructions.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 293 of 1262 rej09b0437-0100 section 8 direct memory access controller (dmac) the dmac can be used in place of the cpu to perform high-speed transfers between external devices that have dack (transfer request acknowledge signal), external memory, on-chip memory, memory-mapped external devi ces, and on-chip peripheral modules. 8.1 features ? number of channels: eight channels (channels 0 to 7) selectable two channels (channels 0 and 1) can receive external requests. ? 4-gbyte physical address space ? data transfer unit is selectable: byte, word (t wo bytes), longword (four bytes), and 16 bytes (longword 4) ? maximum transfer count: 16,777,216 transfers (24 bits) ? address mode: dual address mode and single address mode are supported. ? transfer requests ? external request ? on-chip peripheral module request ? auto request the following modules can issue on -chip peripheral module requests. ? six scif sources, two iic3 sources, two cmt sources, two ssi sources, and two sdhi sources ? selectable bus modes ? cycle steal mode (normal mode and intermittent mode) ? burst mode ? selectable channel priority levels: the channel priority levels are selectable between fixed mode and round-robin mode. ? interrupt request: an interrupt request can be sent to the cpu on completion of half- or full- data transfer. through the he and hie bits in chcr, an interrupt is specified to be issued to the cpu when half of the initially sp ecified dma transfer is completed. ? external request detection: there are follo wing four types of dreq input detection. ? low level detection ? high level detection ? rising edge detection ? falling edge detection
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 294 of 1262 rej09b0437-0100 ? transfer request acknowledge and transfer end signals: active levels for dack and tend can be set independently. ? support of reload functions in dma transfer information regi sters: dma transfer using the same information as the current transfer can be repeated automatically without specifying the information again. modifying the reload registers during dma transfer enables next dma transfer to be done using different transfer information. the reload function can be enabled or disabled in each channel and in each reload register.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 295 of 1262 rej09b0437-0100 figure 8.1 shows the block diagram of the dmac. on-chip peripheral module dma transfer request signal dma transfer acknowledge signal peripheral bus internal bus external rom on-chip memory interrupt controller dreq0 to dreq3 hein dack0 to dack3, tend0, tend1 external ram bus interface bus state controller external device (memory mapped) external device (with acknowledge) request priority control start-up control register control iteration control rdmatcr_n dmatcr_n rsar_n sar_n dar_n rdar_n chcr_n dmaor dmars0 to dmars3 rdmatcr: dmatcr: rsar: sar: rdar: dar: dma reload transfer count register dma transfer count register dma reload source address register dma source address register dma reload destination address register dma destination address register chcr: dmaor: dmars0 to dmars3: hein: dein: n = 0 to 7 dma channel control register dma operation register dma extension resource selectors 0 to 3 dma transfer half-end interrupt request to the cpu dma transfer end interrupt request to the cpu dein [legend] dmac module figure 8.1 block diagram of dmac
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 296 of 1262 rej09b0437-0100 8.2 input/output pins the external pins for dmac are described below. table 8.1 lists the configuration of the pins that are connected to external bus. dmac has pins for two channels (channels 0 and 1) for external bus use. table 8.1 pin configuration channel name abbreviation i/o function dma transfer request dreq0 i dma transfer request input from an external device to channel 0 0 dma transfer request acknowledge dack0 o dma transfer request acknowledge output from channel 0 to an external device dma transfer request dreq1 i dma transfer request input from an external device to channel 1 1 dma transfer request acknowledge dack1 o dma transfer request acknowledge output from channel 1 to an external device 0 dma transfer end tend0 o dma transfer end output for channel 0 1 dma transfer end tend1 o dma transfer end output for channel 1
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 297 of 1262 rej09b0437-0100 8.3 register descriptions the dmac has the registers listed in table 8.2. there are four co ntrol registers and three reload registers for each channel, and one common control register is used by all channels. in addition, there is one extension resource selector per two ch annels. each channel number is expressed in the register names, as in sar_0 for sar in channel 0. table 8.2 register configuration channel register name abbrevi ation r/w initial value address access size dma source address register_0 sar_0 r/w h'00000000 h'fffe1000 16, 32 dma destination address register_0 dar_0 r/w h'00000000 h'fffe1004 16, 32 dma transfer count register_0 dmatcr_0 r/w h'000 00000 h'fffe1008 16, 32 dma channel control register_0 chcr_0 r/w * 1 h'00000000 h'fffe100c 8, 16, 32 dma reload source address register_0 rsar_0 r/w h'00000000 h'fffe1100 16, 32 dma reload destination address register_0 rdar_0 r/w h'000000 00 h'fffe1104 16, 32 0 dma reload transfer count register_0 rdmatcr_0 r/w h'000 00000 h'fffe1108 16, 32 dma source address register_1 sar_1 r/w h'00000000 h'fffe1010 16, 32 dma destination address register_1 dar_1 r/w h'00000000 h'fffe1014 16, 32 dma transfer count register_1 dmatcr_1 r/w h'000 00000 h'fffe1018 16, 32 dma channel control register_1 chcr_1 r/w * 1 h'00000000 h'fffe101c 8, 16, 32 dma reload source address register_1 rsar_1 r/w h'00000000 h'fffe1110 16, 32 dma reload destination address register_1 rdar_1 r/w h'000000 00 h'fffe1114 16, 32 1 dma reload transfer count register_1 rdmatcr_1 r/w h'000 00000 h'fffe1118 16, 32
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 298 of 1262 rej09b0437-0100 channel register name abbrevi ation r/w initial value address access size dma source address register_2 sar_2 r/w h'00000000 h'fffe1020 16, 32 dma destination address register_2 dar_2 r/w h'00000000 h'fffe1024 16, 32 dma transfer count register_2 dmatcr_2 r/w h'000 00000 h'fffe1028 16, 32 dma channel control register_2 chcr_2 r/w * 1 h'00000000 h'fffe102c 8, 16, 32 dma reload source address register_2 rsar_2 r/w h'00000000 h'fffe1120 16, 32 dma reload destination address register_2 rdar_2 r/w h'000000 00 h'fffe1124 16, 32 2 dma reload transfer count register_2 rdmatcr_2 r/w h'000 00000 h'fffe1128 16, 32 dma source address register_3 sar_3 r/w h'00000000 h'fffe1030 16, 32 dma destination address register_3 dar_3 r/w h'00000000 h'fffe1034 16, 32 dma transfer count register_3 dmatcr_3 r/w h'000 00000 h'fffe1038 16, 32 dma channel control register_3 chcr_3 r/w * 1 h'00000000 h'fffe103c 8, 16, 32 dma reload source address register_3 rsar_3 r/w h'00000000 h'fffe1130 16, 32 dma reload destination address register_3 rdar_3 r/w h'000000 00 h'fffe1134 16, 32 3 dma reload transfer count register_3 rdmatcr_3 r/w h'000 00000 h'fffe1138 16, 32
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 299 of 1262 rej09b0437-0100 channel register name abbrevi ation r/w initial value address access size dma source address register_4 sar_4 r/w h'00000000 h'fffe1040 16, 32 dma destination address register_4 dar_4 r/w h'00000000 h'fffe1044 16, 32 dma transfer count register_4 dmatcr_4 r/w h'000 00000 h'fffe1048 16, 32 dma channel control register_4 chcr_4 r/w * 1 h'00000000 h'fffe104c 8, 16, 32 dma reload source address register_4 rsar_4 r/w h'00000000 h'fffe1140 16, 32 dma reload destination address register_4 rdar_4 r/w h'000000 00 h'fffe1144 16, 32 4 dma reload transfer count register_4 rdmatcr_4 r/w h'000 00000 h'fffe1148 16, 32 dma source address register_5 sar_5 r/w h'00000000 h'fffe1050 16, 32 dma destination address register_5 dar_5 r/w h'00000000 h'fffe1054 16, 32 dma transfer count register_5 dmatcr_5 r/w h'000 00000 h'fffe1058 16, 32 dma channel control register_5 chcr_5 r/w * 1 h'00000000 h'fffe105c 8, 16, 32 dma reload source address register_5 rsar_5 r/w h'00000000 h'fffe1150 16, 32 dma reload destination address register_5 rdar_5 r/w h'000000 00 h'fffe1154 16, 32 5 dma reload transfer count register_5 rdmatcr_5 r/w h'000 00000 h'fffe1158 16, 32
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 300 of 1262 rej09b0437-0100 channel register name abbrevi ation r/w initial value address access size dma source address register_6 sar_6 r/w h'00000000 h'fffe1060 16, 32 dma destination address register_6 dar_6 r/w h'00000000 h'fffe1064 16, 32 dma transfer count register_6 dmatcr_6 r/w h'000 00000 h'fffe1068 16, 32 dma channel control register_6 chcr_6 r/w * 1 h'00000000 h'fffe106c 8, 16, 32 dma reload source address register_6 rsar_6 r/w h'00000000 h'fffe1160 16, 32 dma reload destination address register_6 rdar_6 r/w h'000000 00 h'fffe1164 16, 32 6 dma reload transfer count register_6 rdmatcr_6 r/w h'000 00000 h'fffe1168 16, 32 dma source address register_7 sar_7 r/w h'00000000 h'fffe1070 16, 32 dma destination address register_7 dar_7 r/w h'00000000 h'fffe1074 16, 32 dma transfer count register_7 dmatcr_7 r/w h'000 00000 h'fffe1078 16, 32 dma channel control register_7 chcr_7 r/w * 1 h'00000000 h'fffe107c 8, 16, 32 dma reload source address register_7 rsar_7 r/w h'00000000 h'fffe1170 16, 32 dma reload destination address register_7 rdar_7 r/w h'000000 00 h'fffe1174 16, 32 7 dma reload transfer count register_7 rdmatcr_7 r/w h'000 00000 h'fffe1178 16, 32
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 301 of 1262 rej09b0437-0100 channel register name abbrevi ation r/w initial value address access size common dma operation r egister dmaor r/w * 2 h'0000 h'fffe1200 8, 16 0 and 1 dma extension resource selector 0 dmars0 r/w h'0000 h'fffe1300 16 2 and 3 dma extension resource selector 1 dmars1 r/w h'0000 h'fffe1304 16 4 and 5 dma extension resource selector 2 dmars2 r/w h'0000 h'fffe1308 16 6 and 7 dma extension resource selector 3 dmars3 r/w h'0000 h'fffe130c 16 notes: 1. for the he and te bits in chcrn, only 0 can be written to clear the flags after 1 is read. 2. for the ae and nmif bits in dmaor, only 0 can be written to clear the flags after 1 is read. 8.3.1 dma source addr ess registers (sar) the dma source address registers (sar) are 32-bit readable/writable registers that specify the source address of a dma tr ansfer. during a dma transfer, thes e registers indicate the next source address. when the data of an external device with dack is tran sferred in single address mode, sar is ignored. to transfer data in word (2-byte), longword (4-byte), or 16-byte unit, specify the address with 2- byte, 4-byte, or16-byte address boundary respectively. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: ???????????????? ????????????????
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 302 of 1262 rej09b0437-0100 8.3.2 dma destination address registers (dar) the dma destination address registers (dar) are 32-bit readable/writable registers that specify the destination address of a dma transfer. during a dma tr ansfer, these registers indicate the next destination address. when the data of an external device with dack is transferred in single address mode, dar is ignored. to transfer data in word (2-byte), longword (4-byte), or 16-byte unit, specify the address with 2- byte, 4-byte, or16-byte address boundary respectively. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: ???????????????? ???????????????? 8.3.3 dma transfer count registers (dmatcr) the dma transfer count registers (dmatcr) are 32-bit readable/w ritable registers that specify the number of dma transfers. the transfer count is 1 when the setting is h'00000001, 16,777,215 when h'00ffffff is set, and 16,777,216 (the ma ximum) when h'00000000 is set. during a dma transfer, these regist ers indicate the remain ing transfer count. the upper eight bits of dmatcr are always read as 0, and the write value should always be 0. to transfer data in 16 bytes, one 16-byte transfer (128 bits) counts one. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: ???????????????? ????????????????
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 303 of 1262 rej09b0437-0100 8.3.4 dma channel control registers (chcr) the dma channel control registers (chcr) are 32-bi t readable/writable registers that control the dma transfer mode. the do, am, al, dl, and ds bits which specify the dreq and dack external pin functions can be read and written to in channels 0 and 1, but they are reserved in channels 2 to 7. the tl bit which specifies the tend external pin function can be read and written to in channels 0 and 1, but it is reserved in channels 2 to 7. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r r r/w r r r r r/w r/w r r r/(w) * r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/(w) * r/w bit: initial value: r/w: bit: initial value: r/w: note: only 0 can be written to clear the flag after 1 is read. * tc ?? rld ???? do tl ?? he hie am al dm[1:0] sm[1:0] rs[3:0] dl ds tb ts[1:0] ie te de bit bit name initial value r/w descriptions 31 tc 0 r/w transfer count mode specifies whether to transmit data once or for the count specified in dmatcr by one transfer request. this function is valid only at a request of the peripheral module. note that when this bit is set to 0, the tb bit must not be set to 1 (burst mode). when the scif or iic3 is selected for the trans fer request source, this bit (tc) must not be set to 1. 0: transmits data once by one transfer request. 1: transmits data for the count specified in dmatcr by one transfer request. 30 ? 0 r reserved these bits are always read as 0. the write value should always be 0.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 304 of 1262 rej09b0437-0100 bit bit name initial value r/w descriptions 29 rldsar 0 r/w sar reload function enable or disable sets whether to enable or disable the reload function for sar or dmatcr. 0: disables the reload function for sar or dmatcr. 1: enables the reload function for sar or dmatcr. 28 rlddar 0 r/w dar reload function enable or disable sets whether to enable or disable the reload function for dar or dmatcr. 0: disables the reload function for dar or dmatcr. 1: enables the reload function for dar or dmatcr. 27 to 24 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 23 do 0 r/w dma overrun selects whether dreq is detected by overrun 0 or by overrun 1. this bit is valid only in chcr_0 and chcr_1. this bit is reserved in chcr_2 to chcr_7; it is always read as 0 and the write value should always be 0. 0: detects dreq by overrun 0. 1: detects dreq by overrun 1. 22 tl 0 r/w transfer end level specifies the tend signal output is high active or low active. this bit is valid only in chcr_0 and chcr_1. this bit is reserved in chcr_2 to chcr_7; it is always read as 0 and the write value should always be 0. 0: low-active output from tend 1: high-active output from tend
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 305 of 1262 rej09b0437-0100 bit bit name initial value r/w descriptions 21 ? 0 r reserved these bits are always read as 0. the write value should always be 0. 20 temask 0 r/w te set mask indicates that dma transfer is not terminated when the te bit is set to 1. by setting this bit together with the sar reload function or the dar reload function, dma transfer can be executed until the transfer request is canceled. upon detection of the rising or falling edge of an auto request or external request, this bit is ignored and the dma transfer is terminated when the te bit is set. note that this function is enabled if either of the rldsar bit or the rlddar bit is set to 1. 0: terminates dma if the te bit is set. 1: continues dma even if the te bit is set. 19 he 0 r/(w) * half-end flag this bit is set to 1 when t he transfer count reaches half of the dmatcr value that was specified before transfer starts. if dma transfer ends because of an nmi interrupt, a dma address error, or clearing of the de bit or the dme bit in dmaor before the transfer count reaches half of the initial dmatcr value, the he bit is not set to 1. if dma transfer ends due to an nmi interrupt, a dma address error, or clearing of the de bit or the dme bit in dmaor after the he bit is set to 1, the bit remains set to 1. to clear the he bit, write 0 to it after he = 1 is read. 0: dmatcr > (dmatcr set before transfer starts)/2 during dma transfer or after dma transfer is terminated [clearing condition] ? writing 0 after reading he = 1. 1: dmatcr (dmatcr set before transfer starts)/2
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 306 of 1262 rej09b0437-0100 bit bit name initial value r/w descriptions 18 hie 0 r/w half-end interrupt enable specifies whether to issue an interrupt request to the cpu when the transfer count reaches half of the dmatcr value that was specified before transfer starts. when the hie bit is set to 1, the dmac requests an interrupt to the cpu when the he bit becomes 1. 0: disables an interrupt to be issued when dmatcr = (dmatcr set before transfer starts)/2. 1: enables an interrupt to be issued when dmatcr = (dmatcr set before transfer starts)/2. 17 am 0 r/w acknowledge mode specifies whether dack is output in data read cycle or in data write cycle in dual address mode. in single address mode, dack is always output regardless of the specification by this bit. this bit is valid only in chcr_0 and chcr_1. this bit is reserved in chcr_2 to chcr_7; it is always read as 0 and the write value should always be 0. 0: dack output in read cycle (dual address mode) 1: dack output in write cycle (dual address mode) 16 al 0 r/w acknowledge level specifies the dack (acknowledge) signal output is high active or low active. this bit is valid only in chcr_0 and chcr_1. this bit is reserved in chcr_2 to chcr_7; it is always read as 0 and the write value should always be 0. 0: low-active output from dack 1: high-active output from dack
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 307 of 1262 rej09b0437-0100 bit bit name initial value r/w descriptions 15,14 dm[1:0] 00 r/w destination address mode these bits select whether the dma destination address is incremented, decremented, or left fixed. (in single address mode, dm1 and dm0 bits are ignored when data is transferred to an external device with dack.) 00: fixed destination address 01: destination address is incremented (+1 in 8-bit transfer, +2 in 16-bit transfe r, +4 in 32-bit transfer, +16 in 16-byte transfer) 10: destination address is decremented (?1 in 8-bit transfer, ?2 in 16-bit transfer, ?4 in 32-bit transfer, setting prohibited in 16-byte transfer) 11: setting prohibited 13, 12 sm[1:0] 00 r/w source address mode these bits select whether the dma source address is incremented, decremented, or left fixed. (in single address mode, sm1 and sm0 bits are ignored when data is transferred from an external device with dack.) 00: fixed source address 01: source address is incremented (+1 in byte-unit transfer, +2 in word-unit transfer, +4 in longword- unit transfer, +16 in 16-byte-unit transfer) 10: source address is decremented (?1 in byte-unit transfer, ?2 in word-unit transfer, ?4 in longword- unit transfer, setting prohibited in 16-byte-unit transfer) 11: setting prohibited
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 308 of 1262 rej09b0437-0100 bit bit name initial value r/w descriptions 11 to 8 rs[3:0] 0000 r/w resource select these bits specify which transfer requests will be sent to the dmac. the changing of transfer request source should be done in the state when dma enable bit (de) is set to 0. 0000: external request, dual address mode 0001: setting prohibited 0010: external request/single address mode external address space external device with dack 0011: external request/single address mode external device with dack external address space 0100: auto request 0101: setting prohibited 0110: setting prohibited 0111: setting prohibited 1000: dma extension resource selector 1001: setting prohibited 1010: setting prohibited 1011: setting prohibited 1100: setting prohibited 1101: setting prohibited 1110: setting prohibited 1111: setting prohibited note: external request specification is valid only in chcr_0 to chcr_3. if a request source is selected in channels chcr_4 to chcr_7, no operation will be performed.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 309 of 1262 rej09b0437-0100 bit bit name initial value r/w descriptions 7 6 dl ds 0 0 r/w r/w dreq level dreq edge select these bits specify the sampling method of the dreq pin input and the sampling level. these bits are valid only in chcr_0 and chcr_1. these bits are reserved in chcr_2 to chcr_7; they are always read as 0 and the write value should always be 0. if the transfer request source is specified as an on-chip peripheral module or if an auto-request is specified, the specification by these bits is ignored. 00: dreq detected in low level 01: dreq detected at falling edge 10: dreq detected in high level 11: dreq detected at rising edge 5 tb 0 r/w transfer bus mode specifies the bus mode when dma transfers data. note that the burst mode must not be selected when tc = 0. 0: cycle steal mode 1: burst mode 4, 3 ts[1:0] 00 r/w transfer size these bits specify the size of data to be transferred. select the size of data to be transferred when the source or destination is an on-chip peripheral module register of which transfer size is specified. 00: byte unit 01: word unit (two bytes) 10: longword unit (four bytes) 11: 16-byte (four longword) unit
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 310 of 1262 rej09b0437-0100 bit bit name initial value r/w descriptions 2 ie 0 r/w interrupt enable specifies whether or not an interrupt request is generated to the cpu at the end of the dma transfer. setting this bit to 1 generates an interrupt request (dei) to the cpu when te bit is set to 1. 0: disables an interrupt request. 1: enables an interrupt request. 1 te 0 r/(w) * transfer end flag this bit is set to 1 when dmatcr becomes 0 and dma transfer ends. the te bit is not set to 1 in the following cases. ? dma transfer ends due to an nmi interrupt or dma address error before dmatcr becomes 0. ? dma transfer is ended by clearing the de bit and dme bit in dma operation register (dmaor). to clear the te bit, write 0 after reading te = 1. if the temask bit is 0 and the te bit is set, transfer is not enabled even if the de bit is set to 1. 0: during the dma transfer or dma transfer has been terminated [clearing condition] ? writing 0 after reading te = 1 1: dma transfer ends by the specified count (dmatcr = 0)
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 311 of 1262 rej09b0437-0100 bit bit name initial value r/w descriptions 0 de 0 r/w dma enable enables or disables the dma transfer. in auto request mode, dma transfer starts by setting the de bit and dme bit in dmaor to 1. in this case, all of the bits te, nmif in dmaor, and ae must be 0. in an external request or peripheral module request, dma transfer starts if dma transfer request is generated by the devices or peripheral modules after setting the bits de and dme to 1. if the temask bit is 1, the nmif and ae bits must be 0 upon detection of the low or high level of an external request and at a request of the peripheral module. if the temask bit is 0, the te bit must also be 0. as with auto request mode, all of the te, nmif, and ae bits must be 0 upon detection of the rising or falling edge of an external request. clearing the de bit to 0 can terminate the dma transfer. 0: dma transfer disabled 1: dma transfer enabled note: * only 0 can be written to clear the flag after 1 is read.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 312 of 1262 rej09b0437-0100 8.3.5 dma reload source address registers (rsar) the dma reload source address registers (rsar) are 32-bit readable/writable registers. when the sar reload function is enabled, the rsar value is written to the source address register (sar) at the end of the current dma transfer. in this case, a new value for the next dma transfer can be preset in rsar during the current dm a transfer. when the sar reload function is disabled, rsar is ignored. to transfer data in word (2-byte), longword (4-byte), or 16-byte unit, specify the address with 2- byte, 4-byte, or16-byte address boundary respectively. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: ???????????????? ????????????????
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 313 of 1262 rej09b0437-0100 8.3.6 dma reload destination address registers (rdar) the dma reload destination address registers (r dar) are 32-bit readab le/writable registers. when the dar reload function is enabled, the rdar value is written to the destination address register (sar) at the end of the current dma transfer. in this case, a new value for the next dma transfer can be preset in rdar during the curr ent dma transfer. when the dar reload function is disabled, rdar is ignored. to transfer data in word (2-byte), longword (4-byte), or 16-byte unit, specify the address with 2- byte, 4-byte, or16-byte address boundary respectively. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: ???????????????? ????????????????
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 314 of 1262 rej09b0437-0100 8.3.7 dma reload transfer count registers (rdmatcr) the dma reload transfer count registers (rdm atcr) are 32-bit readable/writable registers. when the sar or dar reload function is enabled, the rdmatcr value is written to the transfer count register (dmatcr) at the end of the curren t dma transfer. in this case, a new value for the next dma transfer can be preset in rdmatcr during the current dma transfer. when the sar or dar reload function is disabled, rdmatcr is ignored. the upper eight bits of rdmatcr are always read as 0, and the write valu e should always be 0. as in dmatcr, the transfer count is 1 when the setting is h'00000001, 16,777,215 when h'00ffffff is set, and 16,777,216 (the maximum) when h'00000000 is set. to transfer data in 16 bytes, one 16-byte transfer (128 bits) counts one. 0000000000000000 r r r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ???????????????? ????????????????
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 315 of 1262 rej09b0437-0100 8.3.8 dma operation register (dmaor) the dma operation register (dmaor) is a 16-bit readable/writable register that specifies the priority level of channels at th e dma transfer. this register also shows the dma transfer status. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r/w r/w r r r/w r/w r r r r r r/(w) * r/(w) * r/w note: only 0 can be written to clear the flag after 1 is read. * bit: initial value: r/w: ?? cms[1:0] ?? pr[1:0] ????? ae nmif dme bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 cms[1:0] 00 r/w c ycle steal mode select these bits select either normal mode or intermittent mode in cycle steal mode. it is necessary that the bus modes of all channels be set to cycle steal mode to make the intermittent mode valid. 00: normal mode 01: setting prohibited 10: intermittent mode 16 executes one dma transfer for every 16 cycles of b clock. 11: intermittent mode 64 executes one dma transfer for every 64 cycles of b clock. 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 316 of 1262 rej09b0437-0100 bit bit name initial value r/w description 9, 8 pr[1:0] 00 r/w priority mode these bits select the priority level between channels when there are transfer requests for multiple channels simultaneously. 00: fixed mode 1: ch0 > ch1 > ch2 > ch3 > ch4 > ch5 > ch6 > ch7 01: fixed mode 2: ch0 > ch4 > ch1 > ch5 > ch2 > ch6 > ch3 > ch7 10: setting prohibited 11: round-robin mode (only supported in ch0 to ch3) 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 ae 0 r/(w) * address error flag indicates whether an address error has occurred by the dmac. when this bit is set, even if the de bit in chcr and the dme bit in dmaor are set to 1, dma transfer is not enabled. this bit can only be cleared by writing 0 after reading 1. 0: no dmac address error 1: dmac address error occurred [clearing condition] ? writing 0 after reading ae = 1 1 nmif 0 r/(w) * nmi flag indicates that an nmi interr upt occurred. when this bit is set, even if the de bit in chcr and the dme bit in dmaor are set to 1, dma transfer is not enabled. this bit can only be cleared by writing 0 after reading 1. when the nmi is input, the dma transfer in progress can be done in one transfer unit. even if the nmi interrupt is input while the dmac is not in operation, the nmif bit is set to 1. 0: no nmi interrupt 1: nmi interrupt occurred [clearing condition] ? writing 0 after reading nmif = 1
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 317 of 1262 rej09b0437-0100 bit bit name initial value r/w description 0 dme 0 r/w dma master enable enables or disables dma transfer on all channels. if the dme bit and de bit in chcr are set to 1, dma transfer is enabled. however, transfer is enabled only when the te bit in chcr of the transfer corresponding channel, the nmif bit in dmaor, and the ae bit are all cleared to 0. clearing the dme bit to 0 can terminate the dma transfer on all channels. 0: dma transfer is disabled on all channels 1: dma transfer is enabled on all channels note: * only 0 can be written to clear the flag after 1 is read. if the priority mode bits are modified after a dma transfer, the channel prio rity is initialized. if fixed mode 2 is specified, the channel priority is specified as ch0 > ch4 > ch1 > ch5 > ch2 > ch6 > ch3 > ch7. if fixed mode 1 is specified, the channel priority is specified as ch0 > ch1 > ch2 > ch3 > ch4 > ch5 > ch6 > ch7. if the round-robin mode is specified, the transfer end channel is reset. table 8.3 show the priority change in each mode (modes 0 to 2) specified by the priority mode bits. in each priority mode, the ch annel priority to accept the next transfer request may change in up to three ways according to the transfer end channel. for example, when the transfer end channel is cha nnel 1, the priority of the channel to accept the next transfer request is speci fied as ch2 > ch3 > ch0 >ch1 > ch4 > ch5 > ch6 > ch7. when the transfer end channel is any one of the channels 4 to 7, round-robin will not be applied and the priority level is not changed at the end of transfer in the channels 4 to 7. the dmac internal operation for an address error is as follows: ? no address error: read (source to dmac) write (dmac to destination) ? address error in source address: nop nop ? address error in destin ation address: read nop
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 318 of 1262 rej09b0437-0100 table 8.3 combinations of priority mode bits priority level at the end of transfer transfer end priority mode bits high low mode ch no. pr[1] pr[0] 0 1 2 3 4 5 6 7 mode 0 (fixed mode 1) any channel 0 0 ch0 ch1 ch2 ch3 ch4 ch5 ch6 ch7 mode 1 (fixed mode 2) any channel 0 1 ch0 ch4 ch1 ch5 ch2 ch6 ch3 ch7 ch0 1 1 ch1 ch2 ch3 ch0 ch4 ch5 ch6 ch7 ch1 1 1 ch2 ch3 ch0 ch1 ch4 ch5 ch6 ch7 ch2 1 1 ch3 ch0 ch1 ch2 ch4 ch5 ch6 ch7 ch3 1 1 ch0 ch1 ch2 ch3 ch4 ch5 ch6 ch7 ch4 1 1 ch0 ch1 ch2 ch3 ch4 ch5 ch6 ch7 ch5 1 1 ch0 ch1 ch2 ch3 ch4 ch5 ch6 ch7 ch6 1 1 ch0 ch1 ch2 ch3 ch4 ch5 ch6 ch7 mode 2 (round-robin mode) ch7 1 1 ch0 ch1 ch2 ch3 ch4 ch5 ch6 ch7
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 319 of 1262 rej09b0437-0100 8.3.9 dma extension resource selectors 0 to 3 (dmars0 to dmars3) the dma extension resource sel ectors (dmars) are 16-bit read able/writable registers that specify the dma transfer sources from peripheral modules in each channel. dmars0 is for channels 0 and 1, dmars1 is for channels 2 and 3, dmars2 is for channels 4 and 5, and dmars3 is for channels 6 and 7. table 8.4 shows the specifiable combinations. this register can specify transfer requests fro m six scif sources, two iic3 sources, two cmt sources, two usb sources, two ssi sources, and two sdhi sources. ? dmars0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: ch1 mid[5:0] ch1 rid[1:0] ch0 rid[1:0] ch0 mid[5:0] ? dmars1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: ch3 mid[5:0] ch3 rid[1:0] ch2 rid[1:0] ch2 mid[5:0] ? dmars2 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: ch5 mid[5:0] ch5 rid[1:0] ch4 rid[1:0] ch4 mid[5:0] ? dmars3 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: ch7 mid[5:0] ch7 rid[1:0] ch6 rid[1:0] ch6 mid[5:0] transfer requests from the various modules specify mid and rid as shown in table 8.4.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 320 of 1262 rej09b0437-0100 table 8.4 dmars settings peripheral module setting value for one channel ({mid, rid}) mid rid function usb_0 h'03 b'000000 b'11 ? usb_1 h'07 b'000001 b'11 ? h'11 b'000100 b'01 transmit sdhi h'12 b'000100 b'10 receive ssi_0 h'23 b'001000 b'11 ? ssi_1 h'27 b'001001 b'11 ? h'61 b'01 transmit iic3_0 h'62 b'011000 b'10 receive h'81 b'10 receive scif_0 h'82 b'100000 b'01 transmit h'85 b'10 receive scif_1 h'86 b'100001 b'01 transmit h'89 b'10 receive scif_2 h'8a b'100010 b'01 transmit cmt_0 h'fb b'111110 b'11 ? cmt_1 h'ff b'111111 b'11 ? when mid or rid other than the values listed in table 8.4 is set, the operation of this lsi is not guaranteed. the transfer request from dmars is valid only when the resource select bits (rs[3:0]) in chcr0 to chcr7 have been set to b'1000. otherwise, even if dmars has been set, the transfer request source is not accepted.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 321 of 1262 rej09b0437-0100 8.4 operation when there is a dma transfer request, the dmac starts the transfer according to the predetermined channel priority order; when the tr ansfer end conditions are satisfied, it ends the transfer. transfer s can be requested in three modes: auto request, external request, and on-chip peripheral module request. in bus mode, the burst mode or the cycle steal mode can be selected. 8.4.1 transfer flow after the dma source address registers (sar), dma destination address registers (dar), dma transfer count registers (dmatcr), dma channel control registers (chcr), dma operation register (dmaor), three reload registers (r sar, rdar, and rdmatcr), and dma extension resource selector (dmars) are set for the target transfer conditions, the dmac transfers data according to the following procedure: 1. checks to see if transfer is enabled (de = 1, dme = 1, temask = 0 and te = 0 [or temask = 1], ae = 0, nmif = 0) 2. when a transfer request comes and transfer is enabled, the dmac transfers one transfer unit of data (depending on the ts[1:0] settings). for an auto request, the transfer begins automatically when the de bit and dme bit are set to 1. the dmatcr value will be decremented by 1 for each transfer. the actual tr ansfer flows vary by ad dress mode and bus mode. 3. when half of the specified transfer count is exceeded (when dmatcr reaches half of the initial value), an hei interrupt is sent to th e cpu if the hie bit in chcr is set to 1. 4. when temask = 0, if transfer has been completed for the specified count (that is, dmatcr reaches 0), the tr ansfer ends normally. if the ie bit in chcr is set to 1 at this time, a dei interrupt is sent to the cpu. when temask = 1, if dmatcr reaches 0, te is set to 1. the specified rsar, rdar, and rdmatc values are reloaded into rsar, rdar, and rdmatc, and the transfer opera tion continues until there are no more transfer requests. 5. when an address error in the dmac or an nmi interrupt is generated, the transfer is terminated. transfers are also terminated wh en the de bit in chcr or the dme bit in dmaor is cleared to 0. figure 8.2 is a flowchart of this procedure.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 322 of 1262 rej09b0437-0100 start initial settings (sar, dar, dmatcr, chcr, dmaor, dmars) de, dme = 1 and nmif, ae, te = 0? no no yes yes transfer request occurs? * 1 transfer (one transfer unit); dmatcr ? 1 dmatcr, sar and dar updated dmatcr = 0? no no yes yes no no no dei interrupt request (when ie = 1) for a request from an on-chip peripheral module, the transfer acknowledge signal is sent to the module. when reload function is enabled, rsar sar, rdar dar, and rdmatcr dmatcr te = 1 nmif = 1 or ae = 1 or de = 0 or dme = 0? nmif = 1 or ae = 1 or de = 0 or dme = 0? transfer end transfer terminated normal end bus mode, transfer request mode, dreq detection system * 3 * 2 yes yes yes dmatcr=1/2 ? hei interrupt request (when he = 1) he=1 when the tc bit in chcr is 0, or for a request from an on-chip peripheral module, the transfer acknowledge signal is sent to the module. notes: 1. in auto-request mode, transfer begins when the nmif, ae, and te bits are cleared to 0 and the de and dme bits are set to 1. 2. dreq level detection in burst mode (external request) or cycle steal mode. 3. dreq edge detection in burst mode (external request), or auto request mode in burst mode. upon detection of the level of an external request or at a request of an on-chip peripheral module, is the temask bit set to 1? figure 8.2 dma transfer flowchart
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 323 of 1262 rej09b0437-0100 8.4.2 dma transfer requests dma transfer requests are basically generated in e ither the data transfer so urce or destination, but they can also be generated in external devices an d on-chip peripheral modules that are neither the transfer source nor destination. transfers can be requested in three modes: auto request, external request, and on-chip peripheral module request. the request mode is selected by the rs[3:0] bits in chcr_0 to chcr_7 and dmars0 to dmars3. (1) auto-request mode when there is no transfer request signal from an external source, as in a memory-to-memory transfer or a transfer between memory and an on-chip peripheral module unable to request a transfer, the auto-request mode allows the dmac to automatically generate a transfer request signal internally. when the de bits in chcr_0 to chcr_7 and the dme bit in dmaor are set to 1, the transfer begins so long as the te bits in chcr_0 to chcr_7, and the ae and nmif bits in dmaor are 0. (2) external request mode in this mode a transfer is perf ormed at the request signals (dre q0 and dreq1) of an external device. choose one of the modes shown in table 8.5 according to th e application system. when the dma transfer is enabled (for level detection, de=1, dme=1, temask = 0 and te = 0 [or temask = 1], ae=0, nmif=0); for edge detection, de=1, dme=1, te=0, ae=0, nmif=0), dma transfer is performed upon a request at the dreq input. table 8.5 selecting external re quest modes with the rs bits rs[3] rs[2] rs[1] rs[0] address mode transfer source transfer destination 0 0 0 0 dual address mode any any 0 external memory, memory-mapped external device external device with dack 0 0 1 1 single address mode external device with dack external memory, memory-mapped external device
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 324 of 1262 rej09b0437-0100 choose to detect dreq by either the edge or level of the signal input with the dl and ds bits in chcr_0 and chcr_1 as shown in table 8.6. the source of the transfer request does not have to be the data transfer source or destination. upon detection of a rising or falling edge, one transfer request in burst mode causes the transfer to cont inue until dmatcr = 0 is reached. in cycle steal mode, one transfer request re sults in a single transfer. table 8.6 selecting external request detection with dl and ds bits chcr dl bit ds bit detection of external request 0 low level detection 0 1 falling edge detection 0 high level detection 1 1 rising edge detection when dreq is accepted, the dreq pin enters th e request accept disabled state (non-sensitive period). after issuing acknowledge dack signal for the accepted dreq, the dreq pin again enters the request accept enabled state. when dreq is used by level detection, there are following two cases by the timing to detect the next dreq after outputting dack. overrun 0: transfer is terminat ed after the same number of tr ansfer has been performed as requests. overrun 1: transfer is terminated after transfers have been performed for (the number of requests plus 1) times. the do bit in chcr selects this overrun 0 or overrun 1. table 8.7 selecting external request detection with do bit chcr do bit external request 0 overrun 0 1 overrun 1
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 325 of 1262 rej09b0437-0100 (3) on-chip peripheral module request in this mode, the transfer is performed in respon se to the dma transfer request signal from an on- chip peripheral module. table 8.8 shows the list of dmac transfer request signals sent from on-chip peripheral modules to dmac. when a transfer request signal is sent in on-chip peripheral module request mode while dma transfer is enabled (de=1, dme=1, temas k = 0 and te = 0 [or temask = 1], ae=0, nmif=0), dma transfer is performed. for on-chip peripheral module requests, there are cases in which the transfer source and destination are fixed; see table 8.8.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 326 of 1262 rej09b0437-0100 table 8.8 selecting on-chip peripheral modu le request modes with rs3 to rs0 bits chcr dmars rs[3:0] mid rid dma transfer request source dma transfer request signal transfer source transfer destination bus mode usb_dma0 (receive fifo full) d0fifo any 000000 11 usb usb_dma0 (transmit fifo empty) any d0fifo usb_dma1 (receive fifo full) d1fifo any 000001 11 usb usb_dma1 (transmit fifo empty) any d1fifo cycle steal or burst 01 sdhi transmit txi (receive data empty) data register any 000100 10 sdhi receive rxi (transmit data full) any data register cycle steal dma0 (transmit mode) any ssitdr0 001000 11 ssi_0 dma0 (receive mode) ssirdr0 any dma1 (transmit mode) any ssitdr1 001001 11 ssi_1 dma1 (receive mode) ssirdr1 any cycle steal or burst 01 iic3_0 transmit txi0 (transmit data empty) any icdrt0 011000 10 iic3_0 receive rxi0 (receive data full) icdrr0 any 01 scif_0 transmit txi0 (transmit fifo data empty) any scftdr_0 100000 10 scif_0 receive rxi0 (receive fifo data full) scfrdr_0 any 01 scif_1 transmit txi1 (transmit fifo data empty) any scftdr_1 100001 10 scif_1 receive rxi1 (receive fifo data full) scfrdr_1 any 01 scif_2 transmit txi2 (transmit fifo data empty) any scftdr_2 100010 10 scif_2 receive rxi2 (receive fifo data full) scfrdr_2 any cycle steal 111110 11 cmt_0 cmi0 (compare match) any any 1000 111111 11 cmt_1 cmi1 (compare match) any any cycle steal or burst
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 327 of 1262 rej09b0437-0100 8.4.3 channel priority when the dmac receives simultaneous transfer re quests on two or more channels, it selects a channel according to a predetermined priority order. three modes (fixed mode 1, fixed mode 2, and round-robin mode) are selected using the pr1 and pr0 bits in dmaor. (1) fixed mode in fixed modes, the priority levels among the channels remain fixed. there are two kinds of fixed modes as follows: fixed mode 1: ch0 > ch1 > ch2 > ch3 > ch4 > ch5 > ch6 > ch7 fixed mode 2: ch0 > ch4 > ch1 > ch5 > ch2 > ch6 > ch3 > ch7 these are selected by the pr1 and pr0 bits in the dma operation register (dmaor). (2) round-robin mode each time one unit of word, byte, longword, or 16 by tes is transferred on one channel, the priority order is rotated. the channel on which the transfer was just finished is rotated to the lowest of the priority order among the four round-robin channels (channels 0 to 4). the priority of the channels other than the round-robin channels (channels 0 to 4) does not change even in round-robin mode. the round-robin mode operation is shown in figure 8.3. the priority in round-robin mode is ch0 > ch1 > ch2 > ch3 > ch4 > ch5 > ch6 > ch7 immediately after a reset. when the round-robin mode has been specified, do not concurrently specify cycle steal mode and burst mode as the bus modes of any two or more channels.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 328 of 1262 rej09b0437-0100 channel 2 is given the lowest priority among the round-robin channels. the priority of channels 0 and 1, which were higher than channel 2, is also shifted. if there is a transfer request only to channel 5 immediately after that, the priority does not change because channel 5 is not a round-robin channel. channel 1 is given the lowest priority among the round-robin channels. the priority of channel 0, which was higher than channel 1, is also shifted. channel 0 is given the lowest priority among the round-robin channels. ch0 > ch1 > ch2 > ch3 > ch4 > ch5 > ch6 > ch7 ch1 > ch2 > ch3 > ch0 > ch4 > ch5 > ch6 > ch7 ch0 > ch1 > ch2 > ch3 > ch4 > ch5 > ch6 > ch7 ch2 > ch3 > ch0 > ch1 > ch4 > ch5 > ch6 > ch7 ch0 > ch1 > ch2 > ch3 > ch4 > ch5 > ch6 > ch7 ch3 > ch0 > ch1 > ch2 > ch4 > ch5 > ch6 > ch7 ch0 > ch1 > ch2 > ch3 > ch4 > ch5 > ch6 > ch7 ch0 > ch1 > ch2 > ch3 > ch4 > ch5 > ch6 > ch7 ch3 > ch0 > ch1 > ch2 > ch4 > ch5 > ch6 > ch7 (1) when channel 0 transfers initial priority order initial priority order initial priority order initial priority order priority order after transfer priority order after transfer priority order after transfer priority order after transfer post-transfer priority order when there is an immediate transfer request to channel 5 only (2) when channel 1 transfers (3) when channel 2 transfers (4) when channel 7 transfers priority order does not change. figure 8.3 round-robin mode
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 329 of 1262 rej09b0437-0100 figure 8.4 shows how the priority order changes when channel 0 and channel 3 transfers are requested simultaneously and a channel 1 transfer is requested during the channel 0 transfer. the dmac operates as follows: 1. transfer requests are generated simultaneously to channels 0 and 3. 2. channel 0 has a higher priority, so the channel 0 transfer begins first (channel 3 waits for transfer). 3. a channel 1 transfer request occurs during the channel 0 transfer (channels 1 and 3 are both waiting) 4. when the channel 0 transfer ends, channel 0 is given the lowest priority among the round-robin channels. 5. at this point, channel 1 has a higher priority than channel 3, so the channel 1 transfer begins (channel 3 waits for transfer). 6. when the channel 1 transfer ends, channel 1 is given the lowest priority among the round-robin channels. 7. the channel 3 transfer begins. 8. when the channel 3 transfer ends, channels 3 and 2 are lowered in priority so that channel 3 is given the lowest priority among the round-robin channels. transfer request waiting channel(s) dmac operation channel priority (1) channels 0 and 3 (3) channel 1 0 > 1 > 2 > 3 > 4 > 5 > 6 > 7 (2) channel 0 transfer start (4) channel 0 transfer ends (5) channel 1 transfer starts (6) channel 1 transfer ends (7) channel 3 transfer starts (8) channel 3 transfer ends 1 > 2 > 3 > 0 > 4 > 5 > 6 > 7 2 > 3 > 0 > 1 > 4 > 5 > 6 > 7 0 > 1 > 2 > 3 > 4 > 5 > 6 > 7 priority order changes priority order changes priority order changes none 3 3 1, 3 figure 8.4 changes in channel priority in round-robin mode
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 330 of 1262 rej09b0437-0100 8.4.4 dma transfer types dma transfer has two types; single address mode transfer and dual address mode transfer. they depend on the number of bus cy cles of access to the transfer source and destination. a data transfer timing depends on the bus mode, which is the cycle steal mode or burst mode. the dmac supports the transfers shown in table 8.9. table 8.9 supported dma transfers transfer destination transfer source external device with dack external memory memory-mapped external device on-chip peripheral module on-chip memory external device with dack not available dual, single dual, si ngle not available not available external memory dual, singl e dual dual dual dual memory-mapped external device dual, single dual dual dual dual on-chip peripheral module not available dual dual dual dual on-chip memory not availabl e dual dual dual dual notes: 1. dual: dual address mode 2. single: single address mode 3. 16-byte transfer is available only for on- chip peripheral modules that support longword access.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 331 of 1262 rej09b0437-0100 (1) address modes (a) dual address mode in dual address mode, both th e transfer source and destinati on are accessed (selected) by an address. the transfer source and destination can be located externally or internally. dma transfer requires two bus cycles because data is read from the transfer source in a data read cycle and written to the transfer destination in a da ta write cycle. at this time, transfer data is temporarily stored in the dmac. in the transfer between external memories as shown in figure 8.5, data is read to the dmac from one external me mory in a data read cycle, and then that data is written to the other external memory in a data write cycle. data buffer address bus data bus address bus data bus memory transfer source module transfer destination module memory transfer source module transfer destination module sar dar data buffer sar dar the sar value is an address, data is read from the transfer source module, and the data is tempolarily stored in the dmac. first bus cycle second bus cycle the dar value is an address and the value stored in the data buffer in the dmac is written to the transfer destination module. dmac dmac figure 8.5 data flow of dual address mode auto request, external request, and on-chip peripher al module request are av ailable for the transfer request. dack can be output in read cycle or write cycle in dual address mode. the am bit in the channel control register (chcr) can specify whether the dack is output in read cycle or write cycle. figure 8.6 shows an example of dma transfer timing in dual address mode.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 332 of 1262 rej09b0437-0100 ckio a25 to a0 d31 to d0 dackn (active-low) csn wen rd data read cycle data write cycle (1st cycle) (2nd cycle) transfer source address transfer destination address note: in transfer between external memories, with dack output in the read cycle, dack output timing is the same as that of csn . figure 8.6 example of dma transfer timing in dual mode (transfer source: normal memory, tr ansfer destination: normal memory)
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 333 of 1262 rej09b0437-0100 (b) single address mode in single address mode, both the transfer source and destination are external devices, either of them is accessed (selected) by the dack signal, and the other device is accessed by an address. in this mode, the dmac perf orms one dma transfer in one bus cy cle, accessing one of the external devices by outputting the dack transfer request acknowledge signal to it, and at the same time outputting an address to the other device involved in the transfer. for exam ple, in the case of transfer between external memory and an external device with dack shown in figure 8.7, when the external device outputs data to the data bus, that data is written to the external memory in the same bus cycle. external address bus external data bus dmac external memory dack dreq data flow (from memory to device) data flow (from device to memory) external device with dack this lsi figure 8.7 data flow in single address mode two kinds of transfer are possible in single address mode: (1) tran sfer between an external device with dack and a memory-mapped external device, and (2) transfer between an external device with dack and external memory. in both cases, onl y the external request signal (dreq) is used for transfer requests. figure 8.8 shows an example of dma transfer timing in single address mode.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 334 of 1262 rej09b0437-0100 address output to external memory space select signal to external memory space select signal to external memory space data output from external device with dack dack signal (active-low) to external device with dack write strobe signal to external memory space address output to external memory space data output from external memory space dack signal (active-low) to external device with dack read strobe signal to external memory space (a) external device with dack external memory space (normal memory) (b) external memory space (normal memory) external device with dack ck a25 to a0 d31 to d0 dackn csn wen ck a25 to a0 d31 to d0 dackn csn rd figure 8.8 example of dma transfer timing in single address mode (2) bus modes there are two bus modes; cycle st eal and burst. select the mode by the tb bits in the channel control registers (chcr). (a) cycle steal mode ? normal mode in normal mode of cycle steal, the bus mastersh ip is given to another bus master after a one- transfer-unit (byte, word, longword, or 16-byt e unit) dma transfer. when another transfer request occurs, the bus mastership is obtained from another bus master and a transfer is performed for one transfer unit. when that transfer ends, the bus mastership is passed to another bus master. this is repeated until th e transfer end condit ions are satisfied. the cycle-steal normal mode can be used for an y transfer section; tr ansfer request source, transfer source, and tr ansfer destination. figure 8.9 shows an example of dma transfer timing in cycle-steal normal mode. transfer conditions shown in the figure are; ? dual address mode ? dreq low level detection
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 335 of 1262 rej09b0437-0100 cpu cpu cpu dmac dmac cpu dmac dmac cpu dreq bus cycle bus mastership returned to cpu once read/write read/write figure 8.9 dma transfer exampl e in cycle-steal normal mode (dual address, dreq low level detection) ? intermittent mode 16 and intermittent mode 64 in intermittent mode of cycle steal, dmac returns the bus mastership to other bus master whenever a unit of transfer (byte, word, longword, or 16 bytes) is completed. if the next transfer request occurs after that, dmac obtai ns the bus mastership from other bus master after waiting for 16 or 64 cycles of b clock. dmac then transfers data of one unit and returns the bus mastership to other bus master. these operations are re peated until th e transfer end condition is satisfied. it is thus possible to make lower the ratio of bus occupation by dma transfer than the normal mode of cycle steal. when dmac obtains again the bus mastership, dma transfer may be postponed in case of entry updating due to cache miss. the cycle-steal intermittent mode can be used for any transfer section; transfer request source, transfer source, and transfer de stination. the bus modes, however , must be cycle steal mode in all channels. figure 8.10 shows an example of dma transf er timing in cycle-steal intermittent mode. transfer conditions shown in the figure are; ? dual address mode ? dreq low level detection dreq cpu cpu bus cycle cpu dmac dmac cpu cpu dmac dmac cpu read/write read/write more than 16 or 64 b clock cycles (depends on the cpu's condition of using bus) figure 8.10 example of dma transfer in cycle-steal intermittent mode (dual address, dreq low level detection)
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 336 of 1262 rej09b0437-0100 (b) burst mode in burst mode, once the dmac obtains the bus mastership, it does not release the bus mastership and continues to perform transfer until the transfer end condition is satisfied. in external request mode with low level detection of the dreq pin, however, when the dreq pin is driven high, the bus mastership is passed to another bus master after the dmac transfer request that has already been accepted ends, even if the transfer end conditions have not been satisfied. figure 8.11 shows dma transfer timing in burst mode. cpu cpu cpu dmac dmac dmac dmac cpu dreq bus cycle read read write write cpu figure 8.11 dma transfer example in burst mode (dual address, dreq low level detection) (3) relationship between request modes a nd bus modes by dma transfer category table 8.10 shows the relationship between request modes and bus modes by dma transfer category.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 337 of 1262 rej09b0437-0100 table 8.10 relationship of request mode s and bus modes by dma transfer category address mode transfer category request mode bus mode transfer size (bits) usable channels external device with dack and external memory external b/c 8/16/32/128 0 and 1 external device with dack and memory-mapped external device external b/c 8/16/32/128 0 and 1 external memory and external memory all * 4 b/c 8/16/32/128 0 to 7 * 3 external memory and memory-mapped external device all * 4 b/c 8/16/32/128 0 to 7 * 3 memory-mapped external device and memory- mapped external device all * 4 b/c 8/16/32/128 0 to 7 * 3 external memory and on-chip peripheral module all * 1 b/c * 5 8/16/32/128 * 2 0 to 7 * 3 memory-mapped external device and on-chip peripheral module all * 1 b/c * 5 8/16/32/128 * 2 0 to 7 * 3 on-chip peripheral module and on-chip peripheral module all * 1 b/c * 5 8/16/32/128 * 2 0 to 7 * 3 on-chip memory and on-chip memory all * 4 b/c 8/16/32/128 0 to 7 * 3 on-chip memory and memory-mapped external device all * 4 b/c 8/16/32/128 0 to 7 * 3 on-chip memory and on-chip peripheral module all * 1 b/c * 5 8/16/32/128 * 2 0 to 7 * 3 dual on-chip memory and external memory all * 4 b/c 8/16/32/128 0 to 7 * 3 external device with dack and external memory external b/c 8/16/32/128 0 and 1 single external device with dack and memory-mapped external device external b/c 8/16/32/128 0 and 1 [legend] b: burst c: cycle steal notes: 1. external requests, auto requests, and on-chip peripheral module requests are all available. however, in the case of internal module request, along with the exception of cmt as the transfer request source, the requesting module must be designated as the transfer source or the transfer destination. 2. access size permitted for the on-chip perip heral module register functioning as the transfer source or transfer destination. 3. if the transfer request is an external request, channels 0 to 3 are only available. 4. external requests, auto requests, and on-chip peripheral module requests are all available. in the case of on-chip perip heral module requests, however, the cmt are only available. 5. in the case of internal module request, only cycle steal except for the usb, ssi, and cmt as the transfer request source.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 338 of 1262 rej09b0437-0100 (4) bus mode and channel priority in priority fixed mode (ch0 > ch1), when channel 1 is transferring data in burst mode and a request arrives for transfer on channel 0, which has higher-priority, the data transfer on channel 0 will begin immediately. in this case, if the transfer on channel 0 is also in burst mode, the transfer on channel 1 will only resume on comple tion of the transfer on channel 0. when channel 0 is in cycle steal mode, one transfer-unit of data on this channel, which has the higher priority, is transferred. da ta is then transferred continuously to channel 1 without releasing the bus. the bus mastership will then switch between the two in this order: channel 0, channel 1, channel 0, channel 1, etc. that is, the cpu cycle after the data tr ansfer in cycle steal mode is replaced with a burst-mode transfer cycle (priority execution of burst-mode cycle). an example of this is shown in figure 8.12. when multiple channels are in burst mode, data transfer on the channel that has the highest priority is given precedence. when dma transfer is being performed on multiple channels, the bus mastership is not released to another bus-ma ster device until all of the competing burst-mode transfers have b een completed. cpu dma ch1 dma ch1 dma ch0 dma ch1 dma ch0 dma ch1 dma ch1 cpu ch0 ch1 ch0 dmac ch0 and ch1 cycle steal mode dmac ch1 burst mode cpu cpu priority: ch0 > ch1 ch0: cycle steal mode ch1: burst mode dmac ch1 burst mode figure 8.12 bus state when mu ltiple channels are operating in round-robin mode, the priority changes as shown in figure 8.3. note that channels in cycle steal and burst modes must not be mixed.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 339 of 1262 rej09b0437-0100 8.4.5 number of bus cycles and dreq pin sampling timing (1) number of bus cycles when the dmac is the bus master, the number of bus cycles is controlled by the bus state controller (bsc) in the same way as when the cpu is the bus master. for details, see section 7, bus state controller (bsc). (2) dreq pin sampling timing figures 8.13 to 8.16 show the dreq input sampling timings in each bus mode. ckio dreq dack bus cycle (rising) (active-high) 1st acceptance 2nd acceptance cpu cpu cpu acceptance start dmac non sensitive period figure 8.13 example of dreq input det ection in cycle steal mode edge detection ckio dreq (overrun 0 at high level) dack (active-high) bus cycle 1st acceptance cpu cpu cpu dmac ckio dreq (overrun 1 at high level) dack (active-high) bus cycle 2nd acceptance cpu cpu cpu dmac acceptance start acceptance start 2nd acceptance 1st acceptance non sensitive period non sensitive period figure 8.14 example of dreq input det ection in cycle steal mode level detection
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 340 of 1262 rej09b0437-0100 ckio dreq (rising) dack (active-high) bus cycle burst acceptance non sensitive period cpu cpu dmac dmac figure 8.15 example of dreq input de tection in burst mode edge detection ckio dreq (overrun 0 at high level) dack (active-high) bus cycle 2nd acceptance cpu cpu dmac ckio dreq (overrun 1 at high level) dack (active-high) bus cycle 1st acceptance 2nd acceptance non sensitive period non sensitive period cpu cpu dmac 3rd acceptance dmac acceptance start acceptance start acceptance start 1st acceptance figure 8.16 example of dreq input detection in burst mode level detection
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 341 of 1262 rej09b0437-0100 figure 8.17 shows the tend output timing. ckio dack dreq tend bus cycle end of dma transfer dmac cpu cpu cpu dmac figure 8.17 example of dma transfer end signal timing (cycle steal mode level detection) the unit of the dma transfer is divided into multiple bus cycles when 16-byte transfer is performed for an 8-bit, 16-bit, or 32-bit external device, when longword access is performed for an 8-bit or 16-bit external device, or when word access is performed for an 8-bit external device. when a setting is made so that the dma transfer size is divided into multiple bus cycles and the cs signal is negated between bus cycles, note that dack and tend are divided like the cs signal for data alignment as shown in figure 8.18. figures 8.13 to 8.17 show cases in which tack and tend are not divided at the time of dma transfer.
section 8 direct memory access controller (dmac) rev. 1.00 nov. 14, 2007 page 342 of 1262 rej09b0437-0100 ckio address rd data wen wait cs t1 t2 taw t1 t2 dackn (active low) tend (active low) note: tend is asserted for the last unit of dma transfer. if a transfer unit is divided into multiple bus cycles and the cs is negated between the bus cycles, tend is also divided. figure 8.18 bsc normal memory access (no wait, idle cycle 1, longwo rd access to 16-bit device)
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 343 of 1262 rej09b0437-0100 section 9 clock pulse generator (cpg) this lsi has a clock pulse generator (cpg) that generates an internal clock (i ), a peripheral clock (p ), and a bus clock (b ). the cpg consists of a crystal oscillator, pll circuits, and divider circuits. 9.1 features ? four clock operating modes the mode can be selected from among the four clock operating modes based on the frequency range to be used and the input clock type: the crystal resonator, the external clock, the crystal resonator for usb, or the external clock for usb. ? three clocks generated independently an internal clock (i ) for the cpu and cache; a peripheral clock (p ) for the on-chip peripheral modules; a bus clock (b = ckio) for the external bus interface ? frequency change function internal and peripheral clock frequencies can be changed independently using the pll (phase locked loop) circuits and divider circuits within the cpg. frequencies are changed by software using frequency control register (frqcr) settings. ? power-down mode control the clock can be stopped in sleep mode and software standby mode, and specific modules can be stopped using the module standby function. for details on clock control in the power-down modes, see section 11, power-down modes.
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 344 of 1262 rej09b0437-0100 figure 9.1 shows a block diagram of the clock pulse generator. usb_x1 pll circuit 1 ( 8,12,16) crystal oscillator on-chip oscillator peripheral bus bus interface frqcr [legend] : frequency control register extal xtal md_clk1 md_clk0 frqcr cpg control unit clock frequency control circuit standby control circuit usb_x2 1 1/2 1/3 1/4 1/6 1/8 1/12 mtu clock (i , max. 200 mhz) bus clock (b = ckio, max. 66.67 mhz) peripheral clock (p , max. 33.33 mhz) divider 2 1 1/2 1/4 divider 1 ckio crystal oscillator figure 9.1 block diagram of clock pulse generator
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 345 of 1262 rej09b0437-0100 the clock pulse generator blocks function as follows: (1) crystal oscillator the crystal oscillator is an oscillation circuit in which the crystal resonator is connected to the xtal/extal pin or usb_x1/usb_x2 pin. this can be used according to the clock operating mode. (2) divider 1 divider 1 divides the frequency of one of the three clocks: the clock from the crystal resonator or the extal pin, the clock from the ckio pin, and the clock from the crystal resonator or the usb_x1 pin. the division ratio depends on the clock operating mode. (3) pll circuit the pll circuit multiplies the frequency of the output from divider 1 by 8 or 12. the multiplication rate is set by the frequency control register. when this is done, the phase of the rising edge of the internal clock is controlled so that it will agree with the phase of the rising edge of the ckio pin. the input clock to be used depends on the clock operating mode. the clock operating mode is specified using the md_ck0 and md_ck1 pins. for details on the clock operating mode, see table 9.2. (4) divider 2 divider 2 divides the frequency of output of the pll circuit to generate an internal clock, a bus clock, and a peripheral clock. the internal clock can be 1 or 1/2 times the output frequency of the pll circuit, and it should not be lower than the clock frequency on the ckio pin. the peripheral clock can be 1/4, 1/6, 1/8, or 1/12 times the output frequency of the pll circuit, and it should not be higher than the half of the clock frequency on the ckio pin. the bus clock is automatically determined by hardware at the division ratio ag ainst the output frequency of the pll circuit so that it will be 4 times the clock source (when clock mode = 0), 2 times (when clock mode = 1 or 3), or 1 times (when clock mode = 2). (5) clock frequency control circuit the clock frequency control circuit controls the clock frequency using the md_ck0 and md_ck1 pins and the frequency control register (frqcr).
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 346 of 1262 rej09b0437-0100 (6) standby control circuit the standby control circuit controls the states of the clock pulse generator and other modules during clock switching, or sleep or software standby mode. in addition, the standby control register is provided to control the power-down mode of other modules. for details on the standby control register, see section 11, power-down modes. (7) frequency control register (frqcr) the frequency control register (frqcr) has control bits assigned for the following functions: clock output/non-output from the ckio pin during software standby mode, the frequency multiplication ratio of pll circuit, and the frequency division ratio of the internal clock and the peripheral clock (p ).
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 347 of 1262 rej09b0437-0100 9.2 input/output pins table 9.1 lists the clock pulse generator pins and their functions. table 9.1 pin configuration and func tions of the clock pulse generator pin name symbol i/o function (clock operating mode 0) function (clock operating mode 1) function (clock operating mode 2) function (clock operating mode 3) md_ clk0 input sets the clock operating mode. mode control pins md_ clk1 input sets the clock operating mode. xtal output connected to the crystal resonator. (leave this pin open when the crystal resonator is not in use.) leave this pin open. leave this pin open. leave this pin open. crystal input/output pins (clock input pins) extal input connected to the crystal resonator or used to input external clock. used as an external clock input terminal. pull-up this pin. pull-up this pin. clock input/output pin ckio i/o clock output pin. clock output pin clock input pin clock output pin
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 348 of 1262 rej09b0437-0100 pin name symbol i/o function (clock operating mode 0) function (clock operating mode 1) function (clock operating mode 2) function (clock operating mode 3) crystal input/output pins for usb (clock input pins) usb_x1 input connected to the crystal resonator to input the clock for usb only, or used to input external clock. when usb is not used, this pin should be pulled up. connected to the crystal resonator to input the clock for usb only, or used to input external clock. when usb is not used, this pin should be pulled up. connected to the crystal resonator to input the clock for usb only, or used to input external clock. when usb is not used, this pin should be pulled up. connected to the crystal resonator to input the clock for both usb and the lsi, or used to input external clock. usb_x2 output connected to the crystal resonator for usb. (leave this pin open when the crystal resonator is not in use.) connected to the crystal resonator for usb. (leave this pin open when the crystal resonator is not in use.) connected to the crystal resonator for usb. (leave this pin open when the crystal resonator is not in use.) connected to the crystal resonator for both usb and the lsi. (leave this pin open when the crystal resonator is not in use.)
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 349 of 1262 rej09b0437-0100 9.3 clock operating modes table 9.2 shows the relationship between the combinations of the mode control pins (md_ck1 and md_ck0) and the clock operating modes. table 9.3 shows the usable frequency ranges in the clock operating modes. table 9.2 clock operating modes pin values clock i/o mode md_ck1 md_ck0 source output divider 2 pll circuit on/off ckio frequency 0 0 0 extal or crystal resonator ckio 1 on ( 8, 12) (extal or crystal resonator) 4 1 0 1 extal ckio 1/2 on ( 8, 12) (extal or crystal resonator) 2 2 1 0 ckio ? 1/4 on ( 8, 12) (ckio) 3 1 1 usb_x1 or crystal resonator ckio 1/2 on ( 8) (usb_x1 or crystal resonator) 2 ? mode 0 in mode 0, clock is input from the extal pin or the crystal resonator. the pll circuit shapes waveforms and the frequency is multiplied accord ing to the frequency control register setting before the clock is supplied to the lsi. the oscillating frequency for the crystal resonator and extal pin input clock ranges from 15 to 25 mhz*. the frequency range of ckio is from 60 to 100 mhz*. to reduce current supply, pull up the usb_x1 pin and open the usb_x2 pin when usb is not used. note: * these are target values that were set wh en we prepared this hardware manual. we will determine the guaranteed maximum frequencies after the final evaluation result of this lsi is obtained. ? mode 1 in mode 1, clock is input from the extal pin. the pll circuit shapes waveform and the frequency is multiplied according to the frequency co ntrol register setting before the clock is supplied to the lsi. the oscillating frequency for the extal pin input clock ranges from 30* to 50 mhz*. the frequency range of ckio is from 60 to 100 mhz*. to reduce current supply, pull up the usb_x1 pin and open the usb_x2 pin when usb is not used. note: * these are target values that were set wh en we prepared this hardware manual. we will determine the guaranteed maximum frequencies after the final evaluation result of this lsi is obtained.
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 350 of 1262 rej09b0437-0100 ? mode 2 in mode 2, the ckio pin functions as an input pin and draws an external clock signal. the pll circuit shapes waveform and the frequency is multiplied according to the frequency control register setting before the clock is supplied to the lsi. the frequency range of ckio is from 60 to 100 mhz*. to reduce current supply, pull up the extal pin and open the xtal pin when the lsi is used in mode 2. when usb is not used, pull up the usb_x1 pin and open the usb_x2 pin. note: * these are target values that were se t when this hardware manual was prepared. the guaranteed maximum frequencies will be determined after the final evaluation result of this lsi is obtained. ? mode 3 in mode 3, clock is input from the usb_x1 pin or the crystal oscillator. the external clock is input through this pin and waveform is shaped in the pll circuit. then the frequency is multiplied according to the frequency control register setting before the clock is supplied to the lsi. the frequency of ckio is the same as that of the input clock 96 mhz*. to reduce current supply, pull up the extal pin and open the xtal pin when the lsi is used in mode 3. when the usb crystal resonator is not used, open the usb_x2 pin. note: * these are target values that were se t when this hardware manual was prepared. the guaranteed maximum frequencies will be determined after the final evaluation result of this lsi is obtained.
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 351 of 1262 rej09b0437-0100 table 9.3 relationship between clock operating mode and frequency range this table shows the target values that were set when this hardware manual was prepared. the guaranteed maximum frequencies will be determined after the final evaluation result of this lsi is obtained. restrictions: i 200mhz, b 100mhz, p 50mhz, i b p ? 2 pll frequenc y multiplier selectable freque ncy range (mhz) clock operatin g mode frqcr setting * 1 divider 1 pll circuit ratio of internal clock frequencies (i:b:p) * 2 input clock * 3 output clock (ckio pin) internal clock (i ) bus clock (b ) peripheral clock (p ) h'x003 1/1 on ( 8) 8:4:2 15.00 to 25.00 60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 30.00 to 50.00 h'x004 1/1 on ( 8) 8:4:4/3 15.00 to 25.00 60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 20.00 to 33.33 h'x005 1/1 on ( 8) 8:4:1 15.00 to 25.00 60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 15.00 to 25.00 h'x006 1/1 on ( 8) 8:4:2/3 15.00 to 25.00 60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 10.00 to 16.67 h'x013 1/1 on ( 8) 4:4:2 15.00 to 25.00 60.00 to 100.00 60.00 to 100.00 60.00 to 100.00 30.00 to 50.00 h'x014 1/1 on ( 8) 4:4:4/3 15.00 to 25.00 60.00 to 100.00 60.00 to 100.00 60.00 to 100.00 20.00 to 33.33 h'x015 1/1 on ( 8) 4:4:1 15.00 to 25.00 60.00 to 100.00 60.00 to 100.00 60.00 to 100.00 15.00 to 25.00 h'x016 1/1 on ( 8) 4:4:2/3 15.00 to 25.00 60.00 to 100.00 60.00 to 100.00 60.00 to 100.00 10.00 to 16.67 h'x104 1/1 on ( 12) 12:4:2 15.00 to 16.67 60.00 to 66.67 180.00 to 200.00 60.00 to 66.67 30.00 to 33.33 0 h'x106 1/1 on ( 12) 12:4:1 15.00 to 16.67 60.00 to 66.67 180.00 to 200.00 60.00 to 66.67 15.00 to 16.67 h'x003 1/2 on ( 8) 4:2:1 30.00 to 50.00 60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 30.00 to 50.00 h'x004 1/2 on ( 8) 4:2:4/3 30.00 to 50.00 60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 20.00 to 33.33 h'x005 1/2 on ( 8) 4:2:1/2 30.00 to 50.00 60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 15.00 to 25.00 h'x006 1/2 on ( 8) 4:1:1/3 30.00 to 50.00 60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 10.00 to 16.67 h'x013 1/2 on( 8) 2:2:1 30.00 to 50.00 60.00 to 100.00 60.00 to 100.00 60.00 to 100.00 30.00 to 50.00 h'x014 1/2 on( 8) 2:2:2/3 30.00 to 50.00 60.00 to 100.00 60.00 to 100.00 60.00 to 100.00 20.00 to 33.33 h'x015 1/2 on( 8) 2:2:1/2 30.00 to 50.00 60.00 to 100.00 60.00 to 100.00 60.00 to 100.00 15.00 to 25.00 h'x016 1/2 on( 8) 2:2:1/3 30.00 to 50.00 60.00 to 100.00 60.00 to 100.00 60.00 to 100.00 10.00 to 16.67 h'x104 1/2 on ( 12) 6:2:1 30.00 to 33.33 60.00 to 66.67 180.00 to 200.00 60.00 to 66.67 30.00 to 33.33 1 h'x106 1/2 on ( 12) 6:2:1/2 30.00 to 33.33 60.00 to 66.67 180.00 to 200.00 60.00 to 66.67 15.00 to 16.67
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 352 of 1262 rej09b0437-0100 pll frequency multiplier selectable frequency range (mhz) clock operating mode frqcr setting * 1 divider 1 pll circuit ratio of internal clock frequencies (i:b:p) * 2 input clock * 3 output clock (ckio pin) internal clock (i ) bus clock (b ) peripheral clock (p ) h'x003 1/4 on ( 8) 2:1:1/2 60.00 to 100.00 ? 120.00 to 200.00 60.00 to 100.00 30.00 to 50.00 h'x004 1/4 on ( 8) 2:1:1/3 60.00 to 100.00 ? 120.00 to 200.00 60.00 to 100.00 20.00 to 33.33 h'x005 1/4 on ( 8) 2:1:1/4 60.00 to 100.00 ? 120.00 to 200.00 60.00 to 100.00 15.00 to 25.00 h'x006 1/4 on ( 8) 2:1:1/6 60.00 to 100.00 ? 120.00 to 200.00 60.00 to 100.00 10.00 to 16.67 h'x013 1/4 on ( 8) 1:1:1/2 60.00 to 100.00 ? 60.00 to 100.00 60.00 to 100.00 30.00 to 50.00 h'x014 1/4 on ( 8) 1:1:1/3 60.00 to 100.00 ? 60.00 to 100.00 60.00 to 100.00 20.00 to 33.33 h'x015 1/4 on ( 8) 1:1:1/4 60.00 to 100.00 ? 60.00 to 100.00 60.00 to 100.00 15.00 to 25.00 h'x016 1/4 on ( 8) 1:1:1/6 60.00 to 100.00 ? 60.00 to 100.00 60.00 to 100.00 10.00 to 16.67 h'x104 1/4 on ( 12) 3:1:1/2 60.00 to 66.67 ? 180.00 to 200.00 60.00 to 66.67 30.00 to 33.33 2 h'x106 1/4 on ( 12) 3:1:1/4 60.00 to 66.67 ? 180.00 to 200.00 60.00 to 66.67 15.00 to 16.67 h'x003 1/2 on ( 8) 4:2:1 48.00 to 48.00 96.00 to 96.00 192.00 to 192.00 96.00 to 96.00 48.00 to 48.00 h'x004 1/2 on ( 8) 4:2:2/3 48.00 to 48.00 96.00 to 96.00 192.00 to 192.00 96.00 to 96.00 32.00 to 32.00 h'x005 1/2 on ( 8) 4:2:1/2 48.00 to 48.00 96.00 to 96.00 192.00 to 192.00 96.00 to 96.00 24.00 to 24.00 h'x006 1/2 on ( 8) 4:2:1/3 48.00 to 48.00 96.00 to 96.00 192.00 to 192.00 96.00 to 96.00 16.00 to 16.00 h'x013 1/2 on ( 8) 2:2:1 48.00 to 48.00 96.00 to 96.00 96.00 to 96.00 96.00 to 96.00 48.00 to 48.00 h'x014 1/2 on ( 8) 2:2:2/3 48.00 to 48.00 96.00 to 96.00 96.00 to 96.00 96.00 to 96.00 32.00 to 32.00 h'x015 1/2 on ( 8) 2:2:1/2 48.00 to 48.00 96.00 to 96.00 96.00 to 96.00 96.00 to 96.00 24.00 to 24.00 3 h'x016 1/2 on ( 8) 2:2:1/3 48.00 to 48.00 96.00 to 96.00 96.00 to 96.00 96.00 to 96.00 16.00 to 16.00 notes: 1. x in the frqcr register setting de pends on the set value in bits 12 and 13. 2. the ratio of clock frequencies, where t he input clock frequency is assumed to be 1. 3. in mode 0, the frequency of the extal pin input clock or the crystal resonator in mode 1, the frequency of the extal pin input clock in mode 2, the frequency of the ckio pin input clock. in mode 3, the frequency of the usb_x1 pin input clock or the crystal resonator cautions: 1. the frequency of the internal clock is as follows: in mode 0 the frequency on the extal pin the frequency-multiplier of the pll circuit the divisor of the divider 1 in mode 1 (the frequency on the extal pin 1/2) the frequency-multiplier of the pll circuit the divisor of the divider 1
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 353 of 1262 rej09b0437-0100 in mode 2 (the frequency on the ckio pin 1/4) the frequency-multiplier of the pll circuit the divisor of the divider 1 in mode 3 (the frequency on the usb_x1pin 1/2) the frequency-multiplier of the pll circuit the divisor of the divider 1 the frequency of the internal clock shou ld not be set lower than the frequency on the ckio pin. 2. the frequency of the peripheral clock is as follows: in mode 0 the frequency on the extal pin the frequency-multiplier of the pll circuit the divisor of the divider 1 in mode 1 (the frequency on the extal pin 1/2) the frequency-multiplier of the pll circuit the divisor of the divider 1 in mode 2 (the frequency on the ckio pin 1/4) the frequency-multiplier of the pll circuit the divisor of the divider 1 in mode 3 (the frequency on the usb_x1 pin 1/2) the frequency-multiplier of the pll circuit the divisor of the divider 1 the frequency of the peripheral clock should be set to 50 mhz or less, and should not be set higher than one half of the frequency on the ckio pin. 3. the frequency multiplier of pll circuit can be selected as 8 or 12. the divisor of the divider can be selected as 1, 1/2, 1/3, 1/4, 1/6, 1/8, or 1/12. the settings are made in the frequen cy-control register (frqcr). 4. the output frequency of t he pll circuit is as follows: in mode 0 the frequency on the extal pin the frequency-multiplier of the pll circuit in mode 1 (the frequency on the extal pin 1/2) the frequency-multiplier of the pll circuit in mode 2 (the frequency on the ckio pin 1/4) the frequency-multiplier of the pll circuit in mode 3 (the frequency on the usb_x1 pin 1/2) the frequency-multiplier of the pll circuit ensure that the output frequency of t he pll circuit should be 200 mhz or less.
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 354 of 1262 rej09b0437-0100 9.4 register descriptions the clock pulse generator has the following registers. table 9.4 register configuration register name abbreviation r/w initial value address access size frequency control register frqcr r/w h'0003 h'fffe0010 16 9.4.1 frequency control register (frqcr) frqcr is a 16-bit readable/writable register used to specify whether a clock is output from the ckio pin during normal operation mode, software standby mode and standby mode cancellation. the register also specifies the frequency-multiplie r of the pll circuit and the frequency division ratio for the internal clock and peripheral clock (p ). frqcr is accessed by word. frqcr is initialized to h'0003 only by a power-on reset or in deep standby. frqcr retains its previous value in manual reset or software standby mode. the previous value is also retained when an internal reset is triggered by an overflow of the wdt. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000011 r r r/w r/w r r r/w r/w r r r r/w r r/w r/w r/w bit: initial value: r/w: -- ckoen[1:0] - stc[1:0] - - ifc - pfc[2:0] -- - bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 355 of 1262 rej09b0437-0100 bit bit name initial value r/w description 13, 12 ckoen[1:0] 00 r/w clock output enable specifies the ckio pin outputs clock signals, or is set to a fixed level or high impedance (hi-z) during normal operation mode, standby mode, or cancellation of standby mode. if these bits are set to 01, the ckio pin is fixed at low during standby mode or cancellation of standby mode. therefore, t he malfunction of an external circuit caused by an unstable ckio clock during cancellation of standby mode can be prevented. in clock operating mode 2, the ckio pin functions as an input regardless of the value of these bits. in normal operation in standby mode 00 output output off (hi-z) 01 output low-level output 10 output output (unstable clock output) 11 output off (hi-z) output off (hi-z) 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9, 8 stc[1:0] 00 r/w frequency mult iplication ratio of pll circuit 00: 8 time 01: 12 times 10: reserved (setting prohibited) 11: reserved (setting prohibited) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 356 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 ifc 0 r/w internal clock frequency division ratio this bit specifies the frequency division ratio of the internal clock with respect to the output frequency of pll circuit. 0: 1 time 1: 1/2 time 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 to 0 pfc[2:0] 011 r/w periph eral clock frequency division ratio these bits specify the frequency division ratio of the peripheral clock with respect to the output frequency of pll circuit. 000: reserved (setting prohibited) 001: reserved (setting prohibited) 010: reserved (setting prohibited) 011: 1/4 time 100: 1/6 time 101: 1/8 time 110: 1/12 time 111: reserved (setting prohibited)
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 357 of 1262 rej09b0437-0100 9.5 changing the frequency the frequency of the internal clock (i ) and peripheral clock (p ) can be changed either by changing the multiplication rate of pll circuit or by changing the division rates of divider. all of these are controlled by software through the frequ ency control register (frqcr). the methods are described below. 9.5.1 changing the multiplication rate a pll settling time is required when the multiplicat ion rate of pll circuit is changed. the on- chip wdt counts the settling time. 1. in the initial state, the multiplication rate of pll circuit is 8 time. 2. set a value that will become the specified os cillation settling time in the wdt and stop the wdt. the following must be set: wtcsr.tme = 0: wdt stops wtcsr.cks[2:0]: division ratio of wdt count clock wtcnt counter: initial counter value (the wdt count is incremented using the clock after the setting.) 3. set the desired value in the stc1 and stc0 bits. the division ratio can also be set in the ifc and pfc2 to pfc0 bits. 4. this lsi pauses temporarily and the wdt star ts incrementing. the internal and peripheral clocks both stop and the wdt is supplied with the clock. the clock will continue to be output at the ckio pin. this state is the same as so ftware standby mode. whether or not registers are initialized depends on the module. for details, see section 28.3, register states in each operating mode. 5. supply of the clock that has been set begins at wdt count overflow, and this lsi begins operating again. the wdt stops after it overflows.
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 358 of 1262 rej09b0437-0100 9.5.2 changing the division ratio counting by the wdt does not pro ceed if the frequency divisor is changed but the multiplier is not. 1. in the initial state, ifc = b'0 and pfc[2:0] = b'011. 2. set the desired value in the ifc and pfc2 to ifc0 bits. the values that can be set are limited by the clock operating mode and the multiplication rate of pll circuit. note that if the wrong value is set, this lsi will malfunction. 3. after the register bits (ifc and pfc2 to pfc0) have been set, the clock is supplied of the new division ratio. note: when executing the sleep instruction after the frequency has been changed, be sure to read the frequency control register (frqcr) three times before executing the sleep instruction.
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 359 of 1262 rej09b0437-0100 9.6 notes on board design 9.6.1 note on inputting external clock figure 9.2 is an example of connecting the external clock input. when putting the xtal pin in open state, make sure the parasitic capacitance is less than or equal to 10 pf. to stably input the external clock with enough pll st abilizing time at power on or releasing the standby, wait longer than the oscillation stabilizing time. extal xtal external clock input open state example of connection with xtal pin open figure 9.2 example of connecting external clock 9.6.2 note on using an external crystal resonator place the crystal resonator and capacitors cl1 and cl2 as close to the xtal and extal pins as possible. in addition, to minimize induction and th us obtain oscillation at the correct frequency, the capacitors to be attached to the resonator must be grounded to the same ground. do not bring wiring patterns close to these components. cl1 cl2 extal xtal signal lines prohibited this lsi the values for cl1 and cl2 should be determined after consultation with the crystal resonator manufacturer. note: reference value cl1 = 10 pf cl2 = 10 pf figure 9.3 note on using a crystal resonator
section 9 clock pulse generator (cpg) rev. 1.00 nov. 14, 2007 page 360 of 1262 rej09b0437-0100 9.6.3 note on resonator since various characteristics related to the resonato r are closely linked to the user?s board design, thorough evaluation is necessary on the user?s part, using the resonator connection examples shown in this section as a guide. as the parame ters for the oscillation circuit will depend on the floating capacitance of the resonator and the user board, the parameters should be determined in consultation with the resonator ma nufacturer. the design must ensu re that a voltage exceeding the maximum rating is not applied to the resonator pin. 9.6.4 note on using a pll oscillation circuit in the pllvcc and pllvss connection pattern for the pll, signal lines from the board power supply pins must be as short as possible and pattern width must be as wide as possible to reduce inductive interference. in clock operating mode 2 or 3, the extal pin is pulled up and the xtal pin is left open. since the analog power supply pins of the pll are sensitive to the noise, the system may malfunction due to inductive interference at the other power supply pins. to prevent such malfunction, the analog power supply pin vcc and digital power supply pin pvcc should not supply the same resources on th e board if at all possible. pllvcc pllvss vcc vss power supply signal lines prohibited figure 9.4 note on using a pll oscillation circuit
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 361 of 1262 rej09b0437-0100 section 10 watchdog timer (wdt) this lsi includes the watchdog timer (wdt), which externally outputs an overflow signal ( wdtovf ) on overflow of the counter when the value of the counter has not been updated because of a system malfunction. the wdt can simu ltaneously generate an internal reset signal for the entire lsi. the wdt is a single channel timer that counts up the clock oscillation settling period when the system leaves software standby mode or the temporary standby periods that occur when the clock frequency is changed. it can also be used as a general watchdog timer or interval timer. 10.1 features ? can be used to ensure the clock oscillation settling time the wdt is used in leaving software standby mode or the temporary standby periods that occur when the clock frequency is changed. ? can switch between watchdog timer mode and interval timer mode. ? outputs wdtovf signal in watchdog timer mode when the counter overflows in watchdog timer mode, the wdtovf signal is output externally. it is possible to select whether to reset the lsi internally when this happens. either the power-on reset or manual reset signal can be selected as the internal reset type. ? interrupt generation in interval timer mode an interval timer interrupt is generated when the counter overflows. ? choice of eight counter input clocks eight clocks (p 1 to p 1/16384) that are obtained by dividing the peripheral clock can be selected.
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 362 of 1262 rej09b0437-0100 figure 10.1 shows a block diagram of the wdt. wdtovf wtcsr wtcnt wrcsr wdt standby control bus interface divider clock selector clock standby mode peripheral clock standby cancellation reset control clock selection overflow internal reset request * interrupt control interrupt request [legend] wtcsr: wtcnt: wrcsr: watchdog timer control/status register watchdog timer counter watchdog reset control/status register note: * the internal reset signal can be generated by making a register setting. figure 10.1 block diagram of wdt 10.2 input/output pin table 10.1 shows the pin configuration of the wdt. table 10.1 pin configuration pin name symbol i/o function watchdog timer overflow wdtovf output outputs the count er overflow signal in watchdog timer mode
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 363 of 1262 rej09b0437-0100 10.3 register descriptions the wdt has the follo wing registers. table 10.2 register configuration register name abbreviation r/w initial value address access size watchdog timer counter wtcnt r/w h'00 h'fffe0002 16 * watchdog timer control/status register wtcsr r/w h'18 h'fffe0000 16 * watchdog reset control/status register wrcsr r/w h'1f h'fffe0004 16 * note: * for the access size, see section 10.3.4, notes on register access. 10.3.1 watchdog timer counter (wtcnt) wtcnt is an 8-bit readable/writable register that is incremented by cycles of the selected clock signal. when an overflow occurs, it generates a watchdog timer overflow signal ( wdtovf ) in watchdog timer mode and an interrupt in interval timer mode. wtcnt is initialized to h'00 by a power-on reset caused by the res pin or in software standby mode. use word access to write to wtcn t, writing h'5a in the upper byte. use byte access to read from wtcnt. note: the method for writing to wtcnt differs from that for other registers to prevent erroneous writes. see section 10.3.4, no tes on register access, for details. 7654321 0 00000000 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w:
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 364 of 1262 rej09b0437-0100 10.3.2 watchdog timer contro l/status register (wtcsr) wtcsr is an 8-bit readable/writable register composed of bits to select the clock used for the count, overflow flags, and timer enable bit. wtcsr is initialized to h'18 by a power-on reset caused by the res pin or in software standby mode. when used to count the clock oscillation settling time for canceling software standby mode, it retains its value after counter overflow. use word access to write to wtcsr, writing h'a5 in the upper byte. use byte access to read from wtcsr. note: the method for writing to wtcsr differs from that for other registers to prevent erroneous writes. see section 10.3.4, no tes on register access, for details. 7654321 0 00011000 r/(w) r/w r/w r r r/w r/w r/w bit: initial value: r/w: iovf wt/ it tme - - cks[2:0] bit bit name initial value r/w description 7 iovf 0 r/(w) interval timer overflow indicates that wtcnt has overflowed in interval timer mode. this flag is not set in watchdog timer mode. 0: no overflow 1: wtcnt overflow in interval timer mode [clearing condition] ? when 0 is written to iovf after reading iovf 6 wt/ it 0 r/w timer mode select selects whether to use the wdt as a watchdog timer or an interval timer. 0: use as interval timer 1: use as watchdog timer note: when the wtcnt overflows in watchdog timer mode, the wdtovf signal is output externally. if this bit is modified when the wdt is running, the counting-up may not be performed correctly.
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 365 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 tme 0 r/w timer enable starts and stops timer operation. clear this bit to 0 when using the wdt in software standby mode or when changing the clock frequency. 0: timer disabled count-up stops and wtcnt value is retained 1: timer enabled 4, 3 ? all 1 r reserved these bits are always read as 1. the write value should always be 1. clock select these bits select the clock to be used for the wtcnt count from the eight types obtainable by dividing the peripheral clock (p ). the overflow period that is shown inside the parenthesis in the table is the value when the peripheral clock (p ) is 25 mhz. bits 2 to 0 clock ratio overflow cycle 000: 1 p 10.2 s 001: 1/64 p 655.4 s 010: 1/128 p 1.3 ms 011: 1/256 p 2.6 ms 100: 1/512 p 5.2 ms 101: 1/1024 p 10.5 ms 110: 1/4096 p 41.9 ms 111: 1/16384 p 167.8 ms 2 to 0 cks[2:0] 000 r/w note: if the cks2 to cks0 bits are modified when the wdt is running, the counting-up may not be performed correctly. ensure that these bits are modified only when the wdt is not running.
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 366 of 1262 rej09b0437-0100 10.3.3 watchdog reset control/status register (wrcsr) wrcsr is an 8-bit readable/writable register that controls output of the internal reset signal generated by watchdog timer counter (wtcnt) overflow. wrcsr is initialized to h'1f by input of a reset signal from the res pin, but is not initialized by the internal reset signal generated by overflow of the wdt. wrcsr is initialized to h'1f in software standby mode. note: the method for writing to wrcsr differs from that for other registers to prevent erroneous writes. see section 10.3.4, no tes on register access, for details. 7654321 0 00011111 r/(w) r/w r/w r r r r r bit: initial value: r/w: wovf rste rsts - - - - - bit bit name initial value r/w description 7 wovf 0 r/(w) watchdog timer overflow indicates that the wtcnt has overflowed in watchdog timer mode. this bit is not set in interval timer mode. 0: no overflow 1: wtcnt has overflowed in watchdog timer mode [clearing condition] ? when 0 is written to wovf after reading wovf 6 rste 0 r/w reset enable selects whether to generate a signal to reset the lsi internally if wtcnt overflows in watchdog timer mode. in interval timer mode, this setting is ignored. 0: not reset when wtcnt overflows * 1: reset when wtcnt overflows note: * lsi not reset internally, but wtcnt and wtcsr reset within wdt.
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 367 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 rsts 0 r/w reset select selects the type of reset when the wtcnt overflows in watchdog timer mode. in interval timer mode, this setting is ignored. 0: power-on reset 1: manual reset 4 to 0 ? all 1 r reserved these bits are always read as 1. the write value should always be 1. 10.3.4 notes on register access the watchdog timer counter (wtcnt), watchdog timer control/status register (wtcsr), and watchdog reset control/status register (wrcsr) are more difficult to write to than other registers. the procedures for reading or writing to these registers are given below. (1) writing to wtcnt and wtcsr these registers must be written by a word transfer in struction. they cannot be written by a byte or longword transfer instruction. when writing to wtcnt, set the upper byte to h'5a and transfer the lower byte as the write data, as shown in figure 10.2. when writing to wtcsr, set the upper byte to h'a5 and transfer the lower byte as the write data. this transfer proc edure writes the lower byte data to wtcnt or wtcsr. h'5a 15 8 7 0 h'a5 15 8 7 0 write data address: h'fffe0002 wtcnt write write data address: h'fffe0000 wtcsr write figure 10.2 writing to wtcnt and wtcsr
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 368 of 1262 rej09b0437-0100 (2) writing to wrcsr wrcsr must be written by a word access to address h'fffe0004. it cannot be written by byte transfer or longword transfer instructions. procedures for writing 0 to wovf (bit 7) and for writing to rste (bit 6) are different, as shown in figure 10.3. to write 0 to the wovf bit, the write data must be h'a5 in the upper byte and h'00 in the lower byte. this clears the wovf bit to 0. the rste bit is not affected. to write to the rste bit, the upper byte must be h'5a and the lower byte must be the write data. the value of bit 6 of the lower byte is transferred to the rste bit, resp ectively. the wovf bit is not affected. address: h'fffe0004 address: h'fffe0004 h'a5 h'00 15 8 7 0 h'5a 15 8 7 0 writing 0 to the wovf bit writing to the rste and rsts bits write data figure 10.3 writing to wrcsr (3) reading from wtcnt, wtcsr, and wrcsr wtcnt, wtcsr, and wrcsr are read in a meth od similar to other registers. wtcsr is allocated to address h'fffe00 00, wtcnt to address h'fffe0002, and wrcsr to address h'fffe0004. byte transfer instructions must be used for reading from these registers.
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 369 of 1262 rej09b0437-0100 10.4 wdt usage 10.4.1 canceling so ftware standby mode the wdt can be used to cancel software standby mode with an interrupt such as an nmi interrupt. the procedure is described below. (the wdt does not operate when resets are used for canceling, so keep the res pin low until clock oscillation settles.) 1. before making a transition to software standby mode, always clear the tme bit in wtcsr to 0. when the tme bit is 1, an erroneous reset or interval timer interrupt may be generated when the count overflows. 2. set the type of count clock used in the cks[2:0] bits in wtcsr and the initial value of the counter in wtcnt. these values should ensure that the time till count overflow is longer than the clock oscillation settling time. 3. after setting the stby bit of the standby control register (stbcr: see section 11, power- down modes) to 1, the execution of a sleep instruction puts the system in software standby mode and clock operation then stops. 4. the wdt starts counting by detecti ng the edge change of the nmi signal. 5. when the wdt count overflow s, the cpg starts supplying the clock and this lsi resumes operation. the wovf flag in wrcsr is not set when this happens. 10.4.2 changing the frequency to change the frequency used by the pll, use the wdt. when changing the frequency only by switching the divider, do not use the wdt. 1. before changing the frequency, always clear the tme bit in wtcsr to 0. when the tme bit is 1, an erroneous reset or interval timer interrupt may be generated when the count overflows. 2. set the type of count clock used in the cks[2:0] bits in wtcsr and the initial value of the counter in wtcnt. these values should ensure that the time till count overflow is longer than the clock oscillation settling time. however, the wdt counts up using the clock after the setting. 3. when the frequency control register (frqcr) is written to, this lsi stops temporarily. the wdt starts counting. 4. when the wdt count overflows, the cpg resu mes supplying the clock and this lsi resumes operation. the wovf flag in wrcsr is not set when this happens.
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 370 of 1262 rej09b0437-0100 5. the counter stops at the value of h'00. 6. before changing wtcnt after execution of the frequency change instruction, always confirm that the value of wtcnt is h'00 by reading from wtcnt. 10.4.3 using watchdog timer mode 1. set the wt/ it bit in wtcsr to 1 to set the type of count clock in the cks2 to cks0 bits, whether this lsi is to be reset internally or not in the rste bit in wrcsr, and the initial value of the counter in wtcnt. 2. set the tme bit in wtcsr to 1 to start the count in watchdog timer mode. 3. while operating in watchdog timer mode, rewrit e the counter periodically to h'00 to prevent the counter from overflowing. 4. when the counter overflows, the wdt sets the wovf flag in wrcsr to 1, and the wdtovf signal is output externally (figure 10.4). the wdtovf signal can be used to reset the system. the wdtovf signal is output for 64 p clock cycles. 5. if the rste bit in wrcsr is set to 1, a signal to reset the inside of this lsi can be generated simultaneously with the wdtovf signal. the internal reset signal is output for 128 p clock cycles. 6. when a wdt overflow reset is generated simultaneously with a reset input on the res pin, the res pin reset takes priority, and the wovf bit in wrcsr is cleared to 0.
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 371 of 1262 rej09b0437-0100 h'ff h'00 overflow h'00 written in wtcnt internal reset signal * wdtovf signal wtcnt value wdtovf and internal reset generated wt/ it : tme: timer mode select bit timer enable bit h'00 written in wtcnt time 128 p clock cycles 64 p clock cycles note: * internal reset signal occurs only when the rste bit is set to 1. [legend] wt/ it = 1 tme = 1 wovf = 1 wt/ it = 1 tme = 1 figure 10.4 operation in watchdog timer mode
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 372 of 1262 rej09b0437-0100 10.4.4 using interval timer mode when operating in interval timer mode, interval ti mer interrupts are generated at every overflow of the counter. this enables interrupts to be generated at set periods. 1. clear the wt/ it bit in wtcsr to 0, set the type of count clock in the cks[2:0] bits in wtcsr, and set the initial value of the counter in wtcnt. 2. set the tme bit in wtcsr to 1 to start the count in interval timer mode. 3. when the counter overflows, the wdt sets the iovf bit in wtcsr to 1 and an interval timer interrupt request is sent to the intc. the counter then resumes counting. h'ff iti iti iti iti h'00 wtcnt value iti: interval timer interrupt request generation wt/ it = 0 tme = 1 time overflow overflow overflow overflow [legend] figure 10.5 operation in interval timer mode
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 373 of 1262 rej09b0437-0100 10.5 usage notes pay attention to the following points when using the wdt in either the interval timer or watchdog timer mode. 10.5.1 timer variation after timer operation has started, the period from the power-on reset point to the first count up timing of wtcnt varies depending on the time period that is set by the tme bit of wtcsr. the shortest such time period is thus one cycle of the peripheral clock, p , while the longest is the result of frequency division according to the value in the cks[2:0] bits. the timing of subsequent incrementation is in accord with the selected frequency division ratio. accordingly, this time difference is referred to as timer variation. this also applies to the timing of the first incr ementation after wtcnt has been written to during timer operation. 10.5.2 prohibition against setting h'ff to wtcnt when the value in wtcnt reaches h'ff, the wdt assumes that an overflow has occurred. accordingly, when h'ff is set in wtcnt, an in terval timer interrupt or wdt reset will occur immediately, regardless of the current clock selection by the cks[2:0] bits. 10.5.3 system reset by wdtovf signal if the wdtovf signal is input to the res pin of this lsi, this lsi cannot be initialized correctly. avoid input of the wdtovf signal to the res pin of this lsi through glue logic circuits. to reset the entire system with the wdtovf signal, use the circuit shown in figure 10.6. res wdtovf reset input (low active) reset signal to entire system (low active) figure 10.6 example of system reset circuit using wdtovf signal
section 10 watchdog timer (wdt) rev. 1.00 nov. 14, 2007 page 374 of 1262 rej09b0437-0100 10.5.4 manual reset in watchdog timer mode when a manual reset occurs in watchdog timer mode, the bus cycle is continued. if a manual reset occurs while the bus is released or during dmac burst transfer, manual reset exception handling will be pended until the cpu acquires the bus mastership. however, if the duration from generation of the ma nual reset to the bus cycle end is equal to or longer than the duration of the internal manual reset activated, the occurrence of the internal manual reset source is ignored instead of being pended, and the manual re set exception handling is not executed.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 375 of 1262 rej09b0437-0100 section 11 power-down modes in power-down modes, operation of some of the internal peripheral modules and of the cpu stops. this leads to reduced power consumption. thes e modes are canceled by a reset or interrupt. 11.1 features 11.1.1 power-down modes this lsi has the following power-down modes and function: 1. sleep mode 2. software standby mode 3. module standby function table 11.1 shows the transition conditions for entering the modes from the program execution state, as well as the cpu and peripheral module states in each mode and the procedures for canceling each mode. table 11.1 states of power-down modes state * power-down mode transition c onditions cpg cpu cpu register on-chip memory on-chip peripheral modules external memory canceling procedure sleep mode execute sleep instruction with stby bit cleared to 0 in stbcr runs halts held runs runs auto- refreshing ? interrupt ? reset ? dma address error software standby mode execute sleep instruction with stby bit set to 1 in stbcr halts halts held halts (contents are held) halts self- refreshing ? nmi interrupt ? irq interrupt ? reset module standby function set the mstp bits in stbcr2, stbcr3, and stbcr4 to 1 runs runs held specified module halts (contents are held) specified module halts auto- refreshing ? clear mstp bit to 0 ? reset note: * the pin state is retained or set to high impedance. for details, see appendix a, pin states.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 376 of 1262 rej09b0437-0100 11.2 register descriptions the following registers are us ed in power-down modes. table 11.2 register configuration register name abbreviation r/w initial value address access size standby control register stbcr r/w h'00 h'fffe0014 8 standby control register 2 stbcr2 r/w h'00 h'fffe0018 8 standby control register 3 stbcr3 r/w h'00 h'fffe0408 8 standby control register 4 stbcr4 r/w h'00 h'fffe040c 8 system control register 1 syscr1 r/w h'ff h'fffe0402 8 system control register 2 syscr2 r/w h'ff h'fffe0404 8 system control register 3 syscr3 r/w h'00 h'fffe0418 8
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 377 of 1262 rej09b0437-0100 11.2.1 standby control register (stbcr) stbcr is an 8-bit readable/writable register that specifies the state of th e power-down mode. this register is initialized to h'00 by a power-on reset but retains its previous value by a manual reset or in software standby mode. only byte access is valid. note: see section 11.4, usage notes, when writing data to this register. 7654321 0 00000000 r/w r r r r r r r bit: initial value: r/w: stby ??????? bit bit name initial value r/w description 7 stby 0 r/w software standby specifies transition to software standby mode. 0: executing sleep instruct ion puts chip into sleep mode. 1: executing sleep instru ction puts chip into software standby mode. 6 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 378 of 1262 rej09b0437-0100 11.2.2 standby control register 2 (stbcr2) stbcr2 is an 8-bit readable/writable register that controls the operation of modules in power- down modes. stbcr2 is initialized to h'00 by a power-on reset but retains its previous value by a manual reset or in software standby mode. only byte access is valid. note: see section 11.4, usage notes, when writing data to this register. 76543210 bit: initial value: r/w: 00000000 r/wr/wr/wr/wrrrr mstp 10 mstp 9 mstp 8 mstp 7 ???? bit bit name initial value r/w description 7 mstp10 0 r/w module stop 10 when the mstp10 bit is set to 1, the supply of the clock to the h-udi is halted. 0: h-udi runs. 1: clock supply to h-udi halted. 6 mstp9 0 r/w module stop 9 when the mstp9 bit is set to 1, the supply of the clock to the ubc is halted. 0: ubc runs. 1: clock supply to ubc halted. 5 mstp8 0 r/w module stop 8 when the mstp8 bit is set to 1, the supply of the clock to the dmac is halted. 0: dmac runs. 1: clock supply to dmac halted.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 379 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 mstp7 0 r/w module stop 7 when the mstp7 bit is set to 1, the clock supply to the fpu is halted. after the mstp7 bit is set to 1, the value of 0 cannot be written for clearing. in other words, once the mstp7 bit is set to 1 and the clock supply to the fpu is temporarily halted, then the clock supply to the fpu cannot be restarted by clearing the mstp7 bit to 0. if the clock supply to the fpu is halted and then restarted, a power-on reset must be performed for this lsi. 0: fpuc runs. 1: clock supply to fpu halted. 3 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 380 of 1262 rej09b0437-0100 11.2.3 standby control register 3 (stbcr3) stbcr3 is an 8-bit readable/writable register that controls the operation of modules in power- down modes. stbcr3 is initialized to h'00 by a power-on reset but retains its previous value by a manual reset or in software standby mode. only byte access is valid. note: see section 11.4, usage notes, when writing data to this register. 76543210 bit: initial value: r/w: 00000000 r/w r/w r/w r/w r/w r/w r/w r/w mstp 36 mstp 35 mstp 34 mstp 33 mstp 32 mstp 31 hiz mstp 30 bit bit name initial value r/w description 7 hiz 0 r/w port high impedance selects whether the state of a specified pin is retained or the pin is placed in the high-impedance state in software standby mode. see appendix a, pin states to determine the pin to which this control is applied. do not set this bit when the tme bit of wtscr of the wdt is 1. when setting the output pin to the high- impedance state, set the hiz bit with the tme bit being 0. 0: the pin state is held in software standby mode. 1: the pin state is set to the high-impedance state in software standby mode. 6 mstp36 0 r/w module stop 36 when the mstp36 bit is set to 1, the supply of the clock to the stif1 is halted. 0: stif1 runs. 1: clock supply to stif1 halted. 5 mstp35 0 r/w module stop 35 when the mstp35 bit is set to 1, the supply of the clock to the stif0 is halted. 0: stif0 runs. 1: clock supply to stif0 halted.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 381 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 mstp34 0 r/w module stop 34 when the mstp34 bit is set to 1, the supply of the clock to the cmt is halted. 0: cmt runs. 1: clock supply to cmt halted. 3 mstp33 0 r/w module stop 33 when the mstp33 bit is set to 1, the supply of the clock to the iic3 is halted. 0: iic3 runs. 1: clock supply to iic3 halted. 2 mstp32 0 r/w module stop 32 when the mstp32 bit is set to 1, the supply of the clock to the scif2 is halted. 0: scif2 runs. 1: clock supply to scif2 halted. 1 mstp31 0 r/w module stop 31 when the mstp31 bit is set to 1, the supply of the clock to the scif1 is halted. 0: scif1 runs. 1: clock supply to scif1 halted. 0 mstp30 0 r/w module stop 30 when the mstp30 bit is set to 1, the supply of the clock to the scif0 is halted. 0: scif0 runs. 1: clock supply to scif0 halted.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 382 of 1262 rej09b0437-0100 11.2.4 standby control register 4 (stbcr4) stbcr4 is an 8-bit readable/writable register that controls the operation of modules in power- down modes. stbcr4 is initialized to h'00 by a power-on reset but retains its previous value by a manual reset or in software standby mode. only byte access is valid. note: see section 11.4, usage notes, when writing data to this register. 76543210 bit: initial value: r/w: 0000 0 0 r r/w r/w r/w r/w r/w 0 r/w 0 r/w mstp 46 ? mstp 45 mstp 44 mstp 42 mstp 40 mstp 41 mstp 43 bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 mstp46 0 r/w module stop 46 when the mstp46 bit is set to 1, the supply of the clock to the ssi1 is halted. 0: ssi1 runs. 1: clock supply to ssi1 halted. 5 mstp45 0 r/w module stop 45 when the mstp45 bit is set to 1, the supply of the clock to the ssi0 is halted. 0: ssi0 runs. 1: clock supply to ssi0 halted. 4 mstp44 0 r/w module stop 44 when the mstp44 bit is set to 1, the supply of the clock to the hif is halted. 0: hif runs. 1: clock supply to hif halted.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 383 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 mstp43 0 r/w module stop 43 when the mstp43 bit is set to 1, the supply of the clock to the a-dmac is halted. 0: a-dmac runs. 1: clock supply to a-dmac halted. 2 mstp42 0 r/w module stop 42 when the mstp42 bit is set to 1, the supply of the clock to the sdhi is halted. 0: sdhi runs. 1: clock supply to sdhi halted. 1 mstp41 0 r/w module stop 41 when the mstp41 bit is set to 1, the supply of the clock to the usb is halted. 0: usb runs. 1: clock supply to usb halted. 0 mstp40 0 r/w module stop 40 when the mstp40 bit is set to 1, the supply of the clock to the etherc is halted. 0: etherc runs. 1: clock supply to etherc halted.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 384 of 1262 rej09b0437-0100 11.2.5 system control register 1 (syscr1) syscr1 is an 8-bit readable/writable register that enables or disables access to the on-chip ram (high-speed). syscr1 is valid only in byte access. when an rame bit is set to 1, the corresponding on-chip ram (high-speed) area is enabled. when an rame bit is cleared to 0, the corresponding on-chip ram (high-speed) area cannot be accessed. in this case, an undefined value is return ed when reading data or fetching an instruction from the on-chip ram (high-speed), and writing to the on-chip ram (high-speed) is ignored. the initial value of an rame bit is 1. note that when clearing the rame bit to 0 to disable the on-chip ram (high-speed), be sure to execute an instruction to read from or write to the same arbitrary address in each page before setting the rame bit. if such an instruction is not executed, the data last written may not be written to the on-chip ram (high-speed). furthermore, an instruction to access the on-chip ram (high-speed) should not be located immediately after the instru ction to write to syscr1. if an on- chip ram (high-speed) access instruction is set, normal access is not guaranteed. if this bit is set to 1 to enable the on-chip ra m (high-speed), the syscr1 read instruction must be placed immediately after the syscr1 write instruction. if the on -chip ram (high-speed) access instruction is placed immediately after th e syscr1 write instruction, then normal access will not be guaranteed. note: see section 11.4, usage notes, when writing data to this register. 76543210 bit: r/w: 11111111 r r r r r/w r/w r/w r/w ???? rame3 rame2 rame1 rame0 bit bit name initial value r/w description 7 to 4 ? all 1 r reserved these bits are always read as 1. the write value should always be 1. 3 rame3 1 r/w ram enable 3 (corresponding ram addresses: page 3 in on-chip ram (high-speed) * ) 0: on-chip ram (high-speed) disabled 1: on-chip ram (high-speed) enabled
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 385 of 1262 rej09b0437-0100 bit bit name initial value r/w description 2 rame2 1 r/w ram enable 2 (corresponding ram addresses: page 2 in on-chip ram (high-speed) * ) 0: on-chip ram (high-speed) disabled 1: on-chip ram (high-speed) enabled 1 rame1 1 r/w ram enable 1 (corresponding ram addresses: page 1 in on-chip ram (high-speed) * ) 0: on-chip ram (high-speed) disabled 1: on-chip ram (high-speed) enabled 0 rame0 1 r/w ram enable 0 (corresponding ram addresses: page 0 in on-chip ram (high-speed) * ) 0: on-chip ram (high-speed) disabled 1: on-chip ram (high-speed) enabled note: * for specific address for each pag e, see section 27, on-chip ram.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 386 of 1262 rej09b0437-0100 11.2.6 system control register 2 (syscr2) syscr2 is an 8-bit readable/writable register that enables or disables write to the on-chip ram (high-speed). syscr2 is va lid only in byte access. when the ramwe bit is set to 1, writing to th e on-chip ram (high-speed) is enabled. when an ramwe bit is cleared to 0, th e corresponding on-chip ram (hig h-speed) area cannot be written to. in this case, writing to the on-chip ram (high-speed) is ignored. the initial value of an ramwe bit is 1. note that when clearing the ramwe bit to 0 to disable the on-chip ram, be sure to execute an instruction to read from or write to the same arbitrary address in each page before setting the ramwe bit. if such an in struction is not executed, the data last written may not be written to the on-chip ram (high-speed). furthermore, an instruction to access the on-chip ram (high-speed) should not be located immediately after the instru ction to write to syscr2. if an on-chip ram (high-speed) access instruction is se t, normal access is not guaranteed. if this bit is set to 1 to enable writing to the on-chip ram (high-speed), the syscr2 read instruction must be placed immediately after the syscr2 writ e instruction. if the on-chip ram (high-speed) access instruction is placed immediat ely after the syscr2 write instruction, then normal access will not be guaranteed. note: see section 11.4, usage notes, when writing data to this register. 7654321 0 11111111 rrrrr/wr/wr/wr/w bit: initial value: r/w: ???? ram we3 ram we2 ram we1 ram we0 bit bit name initial value r/w description 7 to 4 ? all 1 r reserved these bits are always read as 1. the write value should always be 1. 3 ramwe3 1 r/w ram write enable 3 (corresponding ram addresses: page 3 in on-chip ram (high-speed) * ) 0: on-chip ram (high-speed) write disabled 1: on-chip ram (high-speed) write enabled
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 387 of 1262 rej09b0437-0100 bit bit name initial value r/w description 2 ramwe2 1 r/w ram write enable 2 (corresponding ram addresses: page 2 in on-chip ram (high-speed) * ) 0: on-chip ram (high-speed) write disabled 1: on-chip ram (high-speed) write enabled 1 ramwe1 1 r/w ram write enable 1 (corresponding ram addresses: page 1 in on-chip ram (high-speed) * ) 0: on-chip ram (high-speed) write disabled 1: on-chip ram (high-speed) write enabled 0 ramwe0 1 r/w ram write enable 0 (corresponding ram addresses: page 0 in on-chip ram (high-speed) * ) 0: on-chip ram (high-speed) write disabled 1: on-chip ram (high-speed) write enabled note: * for specific address for each pag e, see section 27, on-chip ram.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 388 of 1262 rej09b0437-0100 11.2.7 system control register 3 (syscr3) syscr3 is an 8-bit readable/writable register th at controls the software reset for ssi0 and ssi1. syscr3 is valid only in byte access. note: see section 11.4, usage notes, when writing data to this register. 76543210 bit: initial value: r/w: 00000000 r r r r r r r/w r/w ?????? ssi0 srst ssi1 srst bit bit name initial value r/w description 7 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 ssi1srst 0 r/w ssi1 software reset controls the ssi1 reset by software. 0: cancels the ssi1 reset. 1: places the ssi1 in reset state. 0 ssi0srst 0 r/w ssi0 software reset controls the ssi0 reset by software. 0: cancels the ssi0 reset 1: places the ssi0 in reset state.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 389 of 1262 rej09b0437-0100 11.3 operation 11.3.1 sleep mode (1) transition to sleep mode executing the sleep instruction wh en the stby bit in stbcr is 0 causes a transition from the program execution state to sleep mode. although the cpu halts immediately after executing the sleep instruction, the contents of its internal registers remain unchanged. the on-chip modules continue to run in sleep mode. clock pulses continue to be output on the ckio pin in clock mode 0, 1, or 3. (2) canceling sleep mode sleep mode is canceled by an in terrupt (nmi, irq, and on-chip peripheral module), dma address error, or reset (power-on reset). ? canceling with an interrupt when an nmi, irq, or on-chip peripheral module interrupt occurs, sleep mode is canceled and interrupt exception handling is executed. when the priority level of the generated interrupt is equal to or lower than the interrupt mask level that is set in the status register (sr) of the cpu, or the interrupt by the on-chip peripheral module is disabled on the module side, the interrupt request is not accepted and sleep mode is not canceled. ? canceling with a dma address error when a dma address error occurs , sleep mode is canceled an d dma address error exception handling is executed. ? canceling with a reset sleep mode is canceled by a power-on reset.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 390 of 1262 rej09b0437-0100 11.3.2 software standby mode (1) transition to software standby mode the lsi switches from a program execution state to software standby mode by executing the sleep instruction when the stby bit in stbcr is 1. in softwa re standby mode, not only the cpu but also the clock and on-chip peripheral modules halt. the clock output from the ckio pin also halts in clock mode 0, 1, or 3. the contents of the cpu remain unchanged. some registers of on-chip peripheral modules are, however, initialized. regarding the states of on-chip peripheral module registers in software standby mode, see section 28.3, regist er states in each operating mode. the cpu takes one cycle to finish writing to stbcr, and then executes processing for the next instruction. however, it takes one or more cycles to actuall y write. therefore, execute a sleep instruction after reading stbcr to have the values written to stbcr by the cpu to be definitely reflected in the sleep instruction. the procedure for switching to software standby mode is as follows: 1. clear the tme bit in the wdt's timer contro l register (wtcsr) to 0 to stop the wdt. 2. set the wdt's timer counter (wtcnt) to 0 an d the cks[2:0] bits in wtcsr to appropriate values to secure the specified oscillation settling time. 3. after setting the stby bit in stbcr to 1, read stbcr. then , execute a sleep instruction.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 391 of 1262 rej09b0437-0100 (2) canceling software standby mode software standby mode is canceled by interrupts (nmi or irq) or a reset (power-on reset). the ckio pin starts outputting the clock in clock mode 0, 1, or 3. ? canceling with an interrupt when the falling edge or rising edge of the nmi pin (selected by the nmi edge select bit (nmie) in interrupt control register 0 (icr0) of the interrupt controller (intc)) or the falling edge or rising edge of an irq pin (irq7 to irq0) (selected by the irqn sense select bits (irqn1s and irqn0s) in interrupt control regist er 1 (icr1) of the interrupt controller (intc)) is detected, clock oscillation is started. this clock pulse is supplied only to the oscillation settling counter (wdt) used to count the oscillation settling time. after the elapse of the time set in the clock select bits (cks[2:0]) in the watchdog timer control/status register (wtcsr) of the wdt befo re the transition to software standby mode, the wdt overflow occurs. since th is overflow indicates that the clock has been stabilized, the clock pulse will be supplied to the entire chip after this overflow. software standby mode is thus cleared and nmi interrupt exception handling (irq interrupt exception handling in the case of irq) starts. however, if the priority le vel of irq interrupt is lower than the interrupt mask level set in the status register (sr) of the cpu, the interrupt request is not accepted and thus the software standby mode is not released. when canceling software standby mode by the nmi interrupt or irq interrupt, set the cks[2:0] bits so that the wdt overflow period will be equal to or longer than the oscillation settling time. the clock output phase of the ckio pin may be unstable immediately after detecting an interrupt and until software standby mode is canceled. when software standby mode is canceled by the falling edge of the nmi pin, the nmi pin should be high when the cpu enters software standby mode (when the clock pulse stops) and should be low when the cpu returns from software standby mode (when the clock is initiated after the oscillation settling). when software standby mode is canceled by the rising edge of the nmi pin, the nmi pin should be low when the cpu enters software standby mode (when the clock pulse stops) and should be high when the cpu returns from software standby mode (when the clock is initiated after the oscillation settling) (this is the same with the irq pin.) ? canceling with a reset when the res pin is driven low, software standby mode is released and this lsi enters the power-on reset state. and if the res pin is driven high after that, the power-on reset exception handling starts. keep the res pin low until the clock oscillation settles.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 392 of 1262 rej09b0437-0100 11.3.3 software standby mode application example this example describes a transition to software standby mode on the falling edge of the nmi signal, and cancellation on the rising edge of the nmi signal. the timing is shown in figure 11.1. when the nmi pin is changed from high to low level while the nmi edge select bit (nmie) in icr is set to 0 (falling edge detection), the nmi in terrupt is accepted. when the nmie bit is set to 1 (rising edge detection) by the nmi exception service routine, the stby bit in stbcr is set to 1, and a sleep instruction is executed, software st andby mode is entered. thereafter, software standby mode is canceled when the nmi pin is changed from low to high level. ck nmi pin nmie bit stby bit lsi state oscillator program execution nmi exception handling nmi exception handling exception service routine software standby mode oscillation settling time figure 11.1 nmi timing in softwa re standby mode (application example)
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 393 of 1262 rej09b0437-0100 11.3.4 module standby function (1) transition to module standby function setting the standby control register mstp bits to 1 halts the supply of clocks to the corresponding on-chip peripheral modules. this function can be used to reduce the power consumption in normal mode and sleep mode. disable a module before placing it in the module standby mode. in addition, do not access the module's registers while it is in the module standby state. the register states are the same as those in soft ware standby mode. for details, see section 28.3, register states in each operating mode. however, the states of the cmt registers are excep tional. in the cmt, all registers are initialized in software standby mode, but retain their previous values in module standby mode. (2) canceling module standby function the module standby function can be canceled by clearing the mstp bits to 0, or by a power-on reset. when taking a module out of the module standby state by clearing the corresponding mstp bit to 0, read the mstp bit to conf irm that it has been cleared to 0.
section 11 power-down modes rev. 1.00 nov. 14, 2007 page 394 of 1262 rej09b0437-0100 11.4 usage notes when writing data to registers related to power-down modes, note the following suggestion. in a case where the cpu writes data to the regi sters related to power-down modes, if the cpu once starts executing the write instruction, the cpu keeps on executing the succeeding instructions without waiting for the completion of writing data to the registers. if reflecting a change of writing data to registers becomes nece ssary while the cpu is performing the succeeding instructions, execute a dummy read for the same register between the write instruction to the register and the succeeding instructions.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 395 of 1262 rej09b0437-0100 section 12 ethernet controller (etherc) this lsi has an on-chip ethernet controller (etherc) conforming to the ethernet or the ieee802.3 mac (media access control) layer standard. connecting a physical-l ayer lsi (phy-lsi) complying with this standard enables the ethernet controller (etherc) to perform transmission and reception of ethernet/ieee802.3 frames. this lsi has one mac layer interface. the ethernet controller is connect ed to the direct memory access co ntroller for ethernet controller (e-dmac) inside this lsi, and carries out high-speed data transfer to and from the memory. figure 12.1 shows a configuration of the etherc. 12.1 features ? transmission and reception of ethernet/ieee802.3 frames ? supports 10/100 m bps receive/transfer ? supports full-duplex and half-duplex modes ? conforms to ieee 802.3u standard mii (media independent interface) ? magic packet detection and wake-on-lan (wol) signal output ? conforms to ieee802.3x flow control
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 396 of 1262 rej09b0437-0100 mac etherc phy e-dmac e-dmac interface receive controller transmit controller command status interface mii figure 12.1 config uration of etherc
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 397 of 1262 rej09b0437-0100 12.2 input/output pins table 12.1 lists the pin configuration of the etherc. table 12.1 pin configuration port abbreviation i/o function 0 tx-clk * input transmit clock timing reference signal for the tx-en, mii_txd3 to mii_txd0, tx-er signals 0 rx-clk * input receive clock timing reference signal for the rx-dv, mii_rxd3 to mii_rxd0, rx-er signals 0 tx-en * output transmit enable indicates that transmit data is ready on pins mii_txd3 to mii_txd0. 0 mii_txd3 to mii_txd0 * output transmit data 4-bit transmit data 0 tx-er * output transmit error notifies the phy-lsi of error during transmission 0 rx-dv * input receive data valid indicates that valid receive data is on pins mii_rxd3 to mii_rxd0. 0 mii_rxd3 to mii_rxd0 * input receive data 4-bit receive data 0 rx-er * input receive error identifies error state occu rred during data reception. 0 crs input carrier detection carrier detection signal 0 col input collision detection collision detection signal 0 mdc output management data clock reference clock signal for information transfer via mdio 0 mdio input/ output management data i/o bidirectional signal for exchange of management information between this lsi and phy
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 398 of 1262 rej09b0437-0100 port abbreviation i/o function 0 lnksta input link status inputs link status from phy 0 exout output general-p urpose external output signal indicating value of register-bit (ecmr0-elb) 0 wol output wake-on-lan signal indicating reception of magic packet note: * mii signal conforming to ieee802.3u
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 399 of 1262 rej09b0437-0100 12.3 register description the etherc has the following registers. for details on addresses and access sizes of registers, see section 28, list of registers. mac layer interface control registers: ? etherc mode register (ecmr) ? etherc status register (ecsr) ? etherc interrupt permission register (ecsipr) ? phy interface register (pir) ? mac address high register (mahr) ? mac address low register (malr) ? receive frame length register (rflr) ? phy status register (psr) ? transmit retry over counter register (trocr) ? delayed collision detect counter register (cdcr) ? lost carrier counter register (lccr) ? carrier not detect coun ter register (cndcr) ? crc error frame counter register (cefcr) ? frame receive error counter register (frecr) ? too-short frame receive counter register (tsfrcr) ? too-long frame receive counter register (tlfrcr) ? residual-bit frame counter register (rfcr) ? multicast address frame counter register (mafcr) ? ipg register (ipgr) ? automatic pause frame set register (apr) ? manual pause frame set register (mpr) ? pause frame retransfer count set register (tpauser)
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 400 of 1262 rej09b0437-0100 12.3.1 etherc mode register (ecmr) ecmr is a 32-bit readable/writable register an d specifies the operating mode of the ethernet controller. the settings in this register are norma lly made in the initialization process following a reset. the operating mode setting must not be changed while the transmitting an d receiving functions are enabled. to switch the opera ting mode, return the etherc and e-dmac to their initial states by means of the swr bit in edmr before making settings again. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrr/wr/wr/wr/w 0000000000000000 r r r r/w r r r/w r r r/w r/w r r/w r/w r/w r/w ------------zpfpfrrxftxf - - - prcef - - mpde - - re te - ilb elb dm prm bit bit name initial value r/w description 31 to 20 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 19 zpf 0 r/w 0 time parameter pause frame use enable 0: disables pause frame control in which the time parameter is 0. the next frame is transmitted after the time indicated by the timer value has elapsed. when the etherc receives a pause frame with the time indicated by the timer value set to 0, the pause frame is discarded. 1: enables pause frame control in which the time parameter is 0. a pause frame with the timer value set to 0 is transmitted when the number of data in the receive fifo is less than the fcftr value before the time indicated by the timer value has not elapsed. when the etherc receives a pause frame with the time indicated by the timer value set to 0, the transmit wait state is canceled.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 401 of 1262 rej09b0437-0100 bit bit name initial value r/w description 18 pfr 0 r/w pause frame receive mode 0: pause frame is not transferred to the e-dmac 1: pause frame is transferred to the e-dmac 17 rxf 0 r/w receive flow control operating mode 0: pause frame detection function is disabled 1: receive flow control function is enabled 16 txf 0 r/w transmit flow control operating mode 0: transmit flow control function is disabled 1: transmit flow control function is enabled 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 prcef 0 r/w permit receive crc error frame 0: a frame with a crc error is received as a frame with an error. 1: a frame with a crc error is received as a frame without an error. for a frame with an error, a crc error is reflected in the ecsr of the e-dmac and the status of the receive descriptor. for a frame without an error, the frame is received as normal frame. 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 mpde 0 r/w magic packet detection enable enables or disables magic packet detection by hardware to allow activation from the ethernet. 0: magic packet detection is not enabled 1: magic packet detection is enabled 8, 7 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 402 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 re 0 r/w reception enable if a frame is being received when this bit is switched from receive function enabled (re = 1) to disabled (re = 0), the receive function will be enabled until reception of the corresponding frame is completed. 0: receive function is disabled 1: receive function is enabled 5 te 0 r/w transmission enable if a frame is being transmitted when this bit is switched from transmit function enabled (te = 1) to disabled (te = 0), the transmit function will be enabled until transmission of the corresponding frame is completed. 0: transmit function is disabled 1: transmit function is enabled 4 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 3 ilb 0 r/w internal loop back mode specifies loopback mode in the etherc. 0: normal data transmission/reception is performed. 1: when dm = 1, data loopback is performed inside the mac in the etherc. 2 elb 0 r/w external loop back mode this bit value is output directly to this lsi?s general- purpose external output pin (exout). this bit is used for loopback mode directives, etc., in the lsi, using the exout pin. in order for lsi loopback to be implemented using this function, the lsi must have a pin corresponding to the exout pin. 0: low-level output from the exout pin 1: high-level output from the exout pin 1 dm 0 r/w duplex mode specifies the etherc transfer method. 0: half-duplex transfer is specified 1: full-duplex transfer is specified
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 403 of 1262 rej09b0437-0100 bit bit name initial value r/w description 0 prm 0 r/w promiscuous mode setting this bit enables all ethernet frames to be received. all ethernet frames means all receivable frames, irrespective of differences or enabled/disabled status (destination address, broadcast address, multicast bit, etc.). 0: etherc performs normal operation 1: etherc performs promiscuous mode operation 12.3.2 etherc status register (ecsr) ecsr is a 32-bit readable/writable register and indi cates the status in the etherc. this status can be notified to the cpu by interrupts. when 1 is written to the psrto, lchng, mpd, and icd, the corresponding flags can be clear ed. writing 0 does not affect the flag. for bits that generate interrupt, the interrupt can be enabled or disabled according to the corresponding bit in ecsipr. the interrupts generated due to this status register are indicated in the eci bit in eesr. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 initial value: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrr/wrr/wr/wr/w ---------------- -----------psrto- lchng mpd icd
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 404 of 1262 rej09b0437-0100 bit bit name initial value r/w description 31 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 psrto 0 r/w pause frame retransfer retry over indicates that during the retransfer of pause frames when the flow control is enabled, the number of retries has exceeded the upper limit set in the automatic pause frame retransfer count set register (tpauser). 0: number of pause frame retransfers has not exceeded the upper limit 1: number of pause frame retransfers has exceeded the upper limit 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 lchng 0 r/w link signal change indicates that the lnksta signal input from the phy has changed from high to low or low to high. to check the current link state, refer to the lmon bit in the phy status register (psr). 0: changes in the lnksta signal are not detected 1: changes in the lnksta signal are detected (high to low or low to high) 1 mpd 0 r/w magic packet detection indicates that a magic packet has been detected on the line. 0: magic packet has not been detected 1: magic packet has been detected 0 icd 0 r/w illegal carrier detection indicates that the phy has detected an illegal carrier on the line. if a change in the signal input from the phy occurs before the software recognition period, the correct information may not be obtained. refer to the timing specification for the phy used. 0: lsi has not detected an illegal carrier on the line 1: lsi has detected an illegal carrier on the line
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 405 of 1262 rej09b0437-0100 12.3.3 etherc interrupt perm ission register (ecsipr) ecsipr is a 32-bit readable/writable register th at enables or disables the interrupt sources indicated by ecsr. each bit can disable or enable interrupts corr esponding to the bits in ecsr. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrr/wrr/wr/wr/w ---------------- ----------- psrto ip - lchng ip mpd ip icd ip bit bit name initial value r/w description 31 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 psrtoip 0 r/w pause frame retransfer retry over interrupt enable 0: interrupt notification by the psrto bit is disabled 1: interrupt notification by the psrto bit is enabled 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 lchngip 0 r/w link signal changed interrupt enable 0: interrupt notification by the lchng bit is disabled 1: interrupt notification by the lchng bit is enabled 1 mpdip 0 r/w magic packet detection interrupt enable 0: interrupt notification by the mpd bit is disabled 1: interrupt notification by the mpd bit is enabled 0 icdip 0 r/w illegal carrier detection interrupt enable 0: interrupt notification by the icd bit is disabled 1: interrupt notification by the icd bit is enabled
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 406 of 1262 rej09b0437-0100 12.3.4 phy interface register (pir) pir is a 32-bit readable/writable register that pr ovides a means of accessing the phy registers via the mii. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 000000000000 undefined 000 rrrrrrrrrrrrrr/wr/wr/w ---------------- ------------mdimdommdmdc bit bit name initial value r/w description 31 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 mdi undefined r mii management data-in indicates the level of the mdio pin. 2 mdo 0 r/w mii management data-out outputs the value set to this bit from the mdio pin, when the mmd bit is 1. 1 mmd 0 r/w mii management mode specifies the data read/writ e direction with respect to the mii. 0: read direction is indicated 1: write direction is indicated 0 mdc 0 r/w mii management data clock outputs the value set to this bit from the mdc pin and supplies the mii with the management data clock. for the method of accessing the mii registers, see section 12.4.4, accessing mii registers.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 407 of 1262 rej09b0437-0100 12.3.5 mac address high register (mahr) mahr is a 32 -bit readable/writable register that specifies the upper 32 bits of the 48-bit mac address. the settings in this register are normally made in the initialization process after a reset. the mac address setting must not be changed whil e the transmitting and receiving functions are enabled. to switch the mac address setting, return the etherc and e-dmac to their initial states by means of the swr bit in edmr before making settings again. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ma[47:32] ma[31:16] bit bit name initial value r/w description 31 to 0 ma[47:16] all 0 r/w mac address bits these bits are used to set the upper 32 bits of the mac address. if the mac address is 01-23-45-67-89-ab (hexadecimal), the value set in this register is h'01234567.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 408 of 1262 rej09b0437-0100 12.3.6 mac address low register (malr) malr is a 32-bit readable/writable register that specifies the lower 16 bits of the 48-bit mac address. the settings in this register are normally made in the initialization process after a reset. the mac address setting must not be changed while the transmitting and receiving functions are enabled. to switch the ma c address setting, return the etherc and e-dmac to their initial states by means of the swr bit in edmr before making settings again. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ---------------- ma[15:0] bit bit name initial value r/w description 31 to 16 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 15 to 0 ma[15:0] all 0 r/w mac address bits 15 to 0 these bits are used to set the lower 16 bits of the mac address. if the mac address is 01-23-45-67-89-ab (hexadecimal), the value set in this register is h'000089ab.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 409 of 1262 rej09b0437-0100 12.3.7 receive frame le ngth register (rflr) rflr is a 32-bit readable/writable register and it specifies the maximum frame length (in bytes) that can be received by this lsi. the settings in this register must not be changed while the receiving function is enabled. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w r/w --- - ---- ------------ rfl[11:0] bit bit name initial value r/w description 31 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 to 0 rfl[11:0] all 0 r/w receive frame length 11 to 0 the frame length described here refers to all fields from the destination address up to and including the crc data. frame contents from the destination address up to and including the data are actually transferred to memory. crc data is not included in the transfer. when data that exceeds the specified value is received, the part of the data that exceeds the specified value is discarded. h'000 to h'5ee: 1,518 bytes h'5ef: 1,519 bytes h'5f0: 1,520 bytes : : h'7ff: 2,047 bytes h'800 to h'fff: 2,048 bytes
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 410 of 1262 rej09b0437-0100 12.3.8 phy status register (psr) psr is a read-only regist er that can read interf ace signals from the phy. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 000000000000000 undefined rrrrrrrrrrrrrrrr ---------------- --------------- lmon bit bit name initial value r/w description 31 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 lmon 0 r lnksta pin status the link status can be read by connecting the link signal output from the phy to the lnksta pin. for the polarity, refer to the phy specifications to be connected.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 411 of 1262 rej09b0437-0100 12.3.9 transmit retry ov er counter register (trocr) trocr is a 32-bit counter that indi cates the number of frames that were unable to be transmitted in 16 transmission attempts including the retransf er. when 16 transmission attempts have failed, trocr is incremented by 1. when the value in this register reaches h'ffffffff, the count is halted. the counter value is cleared to 0 by a write to this register with any value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 151413121110987654321 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w troc[31:16] troc[15:0] bit: initial value: r/w: bit: initial value: r/w: bit bit name initial value r/w description 31 to 0 troc[31:0] all 0 r/w transmit retry over count these bits indicate the number of frames that were unable to be transmitted in 16 transmission attempts including the retransfer.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 412 of 1262 rej09b0437-0100 12.3.10 delayed collision detect counter register (cdcr) cdcr is a 32-bit counter that indicates the number of delayed collisions on all lines from a start of transmission. when the value in this regist er reaches h'ffffffff, count-up is halted. the counter value is cleared to 0 by a write to this register with any value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w cosdc[31:16] cosdc[15:0] bit bit name initial value r/w description 31 to 0 cosdc[31:0] all 0 r/w delayed collision detect count these bits indicate the number of delayed collisions on all lines from a start of transmission.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 413 of 1262 rej09b0437-0100 12.3.11 lost carrier co unter register (lccr) lccr is a 32-bit counter that indicates the number of times the carrier was lost during data transmission. when the value in this register reaches h'ffffffff, the count is halted. the counter value is cleared to 0 by writing to this register with any value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w lcc[31:16] lcc[15:0] bit bit name initial value r/w description 31 to 0 lcc[31:0] all 0 r/w lost carrier count these bits indicate the number of times the carrier was lost during data transmission.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 414 of 1262 rej09b0437-0100 12.3.12 carrier not detect counter register (cndcr) cndcr is a 32-bit counter that in dicates the number of times the carrier could not be detected while the preamble was being sent. when the valu e in this register reac hes h'ffffffff, the count is halted. the counter value is cleared to 0 by a write to this register with any value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w cndc[31:16] cndc[15:0] bit bit name initial value r/w description 31 to 0 cndc[31:0] all 0 r/w carrier not detect count these bits indicate the number of times the carrier was not detected.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 415 of 1262 rej09b0437-0100 12.3.13 crc error frame counter register (cefcr) cefcr is a 32-bit counter that indicates the number of times a frame with a crc error was received. when the value in this register reac hes h'ffffffff, the count is halted. the counter value is cleared to 0 by a write to this register with any value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w cefc[31:16] cefc[15:0] bit bit name initial value r/w description 31 to 0 cefc[31:0] all 0 r/w crc error frame count these bits indicate the count of crc error frames received.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 416 of 1262 rej09b0437-0100 12.3.14 frame receive erro r counter register (frecr) frecr is a 32-bit counter that indicates the numb er of frames input from the phy for which a receive error was indicated by the rx-er pin. frecr is incremented each time the rx-er pin becomes active. when the value in this regist er reaches h'ffffffff, the count is halted. the counter value is cleared to 0 by a write to this register with any value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w frec[31:16] frec[15:0] bit bit name initial value r/w description 31 to 0 frec[31:0] all 0 r/w frame receive error count these bits indicate the count of errors during frame reception.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 417 of 1262 rej09b0437-0100 12.3.15 too-short frame recei ve counter register (tsfrcr) tsfrcr is a 32-bit counter that indicates the number of frames of fewer than 64 bytes that have been received. when the value in this regist er reaches h'ffffffff, the count is halted. the counter value is cleared to 0 by a write to this register with any value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w tsfc[31:16] tsfc[15:0] bit bit name initial value r/w description 31 to 0 tsfc[31:0] all 0 r/w too-short frame receive count these bits indicate the count of frames received with a length of less than 64 bytes.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 418 of 1262 rej09b0437-0100 12.3.16 too-long frame recei ve counter register (tlfrcr) tlfrcr is a 32-bit counter that in dicates the number of frames received with a length exceeding the value specified by the receive frame length register (rflr). when the value in this register reaches h'ffffffff, the count is halted. tlfrcr is not incremented when a frame containing residual bits is received. in this case, the rece ption of the frame is indi cated in the residual-bit frame counter register (rfcr). the counter value is cleared to 0 by a write to this register with any value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w tlfc[31:16] tlfc[15:0] bit bit name initial value r/w description 31 to 0 tlfc[31:0] all 0 r/w too-long frame receive count these bits indicate the count of frames received with a length exceeding the value in rflr.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 419 of 1262 rej09b0437-0100 12.3.17 residual-bit frame counter register (rfcr) rfcr is a 32-bit counter that indicates the numb er of frames received containing residual bits (less than an 8-bit unit). when the value in this register reaches h'ffffff ff, the count is halted. the counter value is cleared to 0 by a wr ite to this register with any value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w rfc[31:16] rfc[15:0] bit bit name initial value r/w description 31 to 0 rfc[31:0] all 0 r/w residual-bit frame count these bits indicate the count of frames received containing residual bits.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 420 of 1262 rej09b0437-0100 12.3.18 multicast address fr ame counter register (mafcr) mafcr is a 32-bit counter that in dicates the number of frames r eceived with a specified multicast address. when the value in this register reaches h'ffffffff, th e count is halted. the counter value is cleared to 0 by a write to this register with any value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w mafc[31:16] mafc[15:0] bit bit name initial value r/w description 31 to 0 mafc[31:0 all 0 r/w mu lticast address frame count these bits indicate the count of multicast frames received.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 421 of 1262 rej09b0437-0100 12.3.19 ipg register (ipgr) ipgr sets the ipg (inter packet gap). this register must not be changed while the transmitting and receiving functions of the et herc mode register (ecmr) are enabled. (for details, refer to section 12.4.6, operation by ipg setting.) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000010100 rrrrrrrrrrrr/wr/wr/wr/wr/w ---------------- ----------- i pg[4:0] bit bit name initial value r/w description 31 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 to 0 ipg[4:0] h'13 r/w inter packet gap sets the ipg value every 4-bit time. h'00: 20-bit time h'01: 24-bit time : : h'13: 96-bit time (initial value) : : h'1f: 144-bit time
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 422 of 1262 rej09b0437-0100 12.3.20 automatic pause frame set register (apr) apr sets the time parameter value of the au tomatic pause frame. when transmitting the automatic pause frame, the value set in this re gister is used as the time parameter of the pause frame. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ---------------- ap[15:0] bit bit name initial value r/w description 31 to 16 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 15 to 0 ap[15:0] all 0 r/w automatic pause sets the time parameter value of the automatic pause frame. at this time, 1 bit means 512-bit time.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 423 of 1262 rej09b0437-0100 12.3.21 manual pause frame set register (mpr) mpr sets the time parameter value of the manu al pause frame. when transmitting the manual pause frame, the value set to this register is used as the time parameter of the pause frame. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ---------------- mp[15:0] bit bit name initial value r/w description 31 to 16 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 15 to 0 mp[15:0] all 0 r/w manual pause sets the time parameter value of the manual pause frame. at this time, 1 bit means 512-bit time. read values are undefined.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 424 of 1262 rej09b0437-0100 12.3.22 pause frame retransfer count set register (tpauser) tpauser sets the upper limit of the number of times of the pause frame retransfer. tpauser must not be changed while the transmitting function is enabled. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ---------------- tpause[15:0] bit bit name initial value r/w description 31 to 16 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 15 to 0 tpause[15: 0] all 0 r/w upper limit of the number of times of pause frame retransfer h'0000: unlimited number of times of retransfer h'0001: retransfer once : : h'ffff: number of times of retransfer is 65535
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 425 of 1262 rej09b0437-0100 12.4 operation the overview of the ethernet controller (ether c) are shown below. the etherc transmits and receives pause frames conforming to the ethernet/ieee802.3 frames. 12.4.1 transmission the etherc transmitter assembles the transmit data on the frame and outputs to mii when there is a transmit request from the e-dmac. the data tran smitted via the mii is transmitted to the lines by phy-lsi. figure 12.3 shows the stat e transition of the et herc transmitter.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 426 of 1262 rej09b0437-0100 fdpx fdpx hdpx hdpx collision collision collision * 2 collision * 2 error error error normal transmission notes: 1. transmission retry processing includes both jam transmission that depends on collision detection and the adjustment of transmission intervals based on the back-off algorithm. 2. transmission is retried only when data of 512 bits or less (including the preamble and sfd) is transmitted. when a collision is detected during the transmission of data greater than 512 bits, only jam is transmitted and transmission based on the back-off algorithm is not retried. error notification transmission halted start of transmission (preamble transmission) carrier detection carrier detection sfd transmission crc transmission data transmission carrier detection failure of 15 retransfer attempts or collision after 512-bit time retransfer processing * 1 error detection retransfer initiation carrier non-detection carrier non-detection idle te set te reset reset [legend] fdpx: full duplex hdpx: half duplex sfd: start frame delimiter figure 12.2 etherc tran smitter state transitions 1. when the transmit enable (te) bit is set, the transmitter enters th e transmit idle state. 2. when a transmit request is issued by the transmit e-dmac, the etherc sends the preamble after a transmission delay equivalent to the frame interval time. if full-duplex transfer is selected, which does not require car rier detection, the preamble is sent as soon as a transmit request is issued by the e-dmac.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 427 of 1262 rej09b0437-0100 3. the transmitter sends the sfd, data, and crc sequentially. at the end of transmission, the transmit e-dmac generates a transmission comp lete interrupt (tc). if a collision or the carrier-not-detected state occurs during data transmission, thes e are reported as interrupt sources. 4. after waiting for the frame interval time, the tran smitter enters the idle state, and if there is more transmit data, continues transmitting. 12.4.2 reception the etherc receiver separates the frame data (mii into preamble, sfd, da (destination address), sa (source address), type/length, data, and crc da ta) and outputs da, sa, type/length, data to the e-dmac. figure 12.3 shows the stat e transitions of the etherc receiver. illegal carrier detection start of frame reception wait for sfd reception data reception crc reception destination address reception preamble detection reception halted reset error notification * re set [legend] sfd: start frame delimiter note: * the error frame also transmits data to the buffer. end of reception receive error detection receive error detection error detection promiscuous and other station destination address re reset normal reception idle rx-dv negation sfd reception own destination address or broadcast or multicast or promiscuous figure 12.3 etherc r eceiver state transmissions
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 428 of 1262 rej09b0437-0100 1. when the receive enable (re) bit is set, the receiver enters the receive idle state. 2. when an sfd (start frame delimiter) is detect ed after a receive packet preamble, the receiver starts receive processing . discards a frame with an invalid pattern. 3. in normal mode, if the destination address matches the receiver?s own address, or if broadcast or multicast transmission or promiscuou s mode is specified, the receive r starts data reception. 4. following data recep tion from the mii, the receiver carries out a crc check. the result is indicated as a status bit in the descriptor af ter the frame data has been written to memory. reports an error status in the case of an abnormality. 5. after one frame has been receiv ed, if the receive enable bit is set (re = 1) in the etherc mode register, the receiver prepares to receive the next frame. 12.4.3 mii frame timing each mii frame timing is shown in figure 12.4. tx-clk tx-en txd3 to txd0 tx-er crs col sfd preamble data crc figure 12.4 (1) mii frame transmit timing (normal transmission) tx-clk tx-en tx-er crs col preamble jam mii_txd3 to mii_txd0 figure 12.4 (2) mii frame transmit timing (collision)
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 429 of 1262 rej09b0437-0100 tx-clk tx-en mii_txd3 to mii_txd0 tx-er crs col sfd preamble data figure 12.4 (3) mii frame tran smit timing (transmit error) rx-clk rx-dv rx-er preamble data crc sfd mii_rxd3 to mii_rxd0 figure 12.4 (4) mii frame r eceive timing (normal reception) rx-clk rx-dv rx-er preamble data xxxx sfd mii_rxd3 to mii_rxd0 figure 12.4 (5) mii frame recei ve timing (reception error (1)) rx-clk rx-dv rx-er xxxx 1110 xxxx mii_rxd3 to mii_rxd0 figure 12.4 (6) mii fame recei ve timing (reception error (2))
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 430 of 1262 rej09b0437-0100 12.4.4 accessing mii registers mii registers in the phy are accessed via this lsi? s phy interface register (pir). connection is made as a serial interface in accordance with the mii frame format specified in ieee802.3u. mii management frame format: the format of an mii management frame is shown in figure 12.8. to access an mii register , a management frame is impl emented by the program in accordance with the proced ures shown in mii register access procedure. access type mii management frame item number of bits read write pre 32 1..1 1..1 st 2 01 01 op 2 10 01 phyad 5 00001 00001 regad 5 rrrrr rrrrr ta 2 z0 10 data 16 d..d d..d idle x pre: st: op: phyad: regad: ta: data: idle: [legend] 32 consecutive 1s write of 01 indicating start of frame write of code indicating access type write of 0001 if the phy address is 1 (sequential write starting with the msb). this bit changes depending on the phy address. write of 0001 if the register address is 1 (sequential write starting with the msb). this bit changes depending on the phy register address. time for switching data transmission source on mii interface (a) write: 10 written (b) read: bus release (notation: z0) performed 16-bit data. sequential write or read from msb (a) write: 16-bit data write (b) read: 16-bit data read wait time until next mii management format input (a) write: independent bus release (notation: x) performed (b) read: bus already released in ta; control unnecessary figure 12.5 mii management frame format
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 431 of 1262 rej09b0437-0100 mii register access procedure: the program accesses mii regi sters via the phy interface register (pir). access is implemented by a combination of 1-bit-unit data write, 1-bit-unit data read, bus release, and independent bus release. figure 12.9 show s the mii register access timing. the timing will differ depending on the phy type. mdc (1) (1) (2) (3) mdo (2) (3) write to phy interface register 1-bit data write timing relationship mmd = 1 mdo = write data mdc = 0 mmd = 1 mdo = write data mdc = 1 write to phy interface register mmd = 1 mdo = write data mdc = 0 write to phy interface register figure 12.6 (1) 1-bit data write flowchart
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 432 of 1262 rej09b0437-0100 mdc (1) (1) (2) (3) write to phy interface register mmd = 0 mdc = 0 bus release timing relationship mdo (2) write to phy interface register mmd = 0 mdc = 1 (3) write to phy interface register mmd = 0 mdc = 0 figure 12.6 (2) bus release flowchart (ta in read in figure 12.5) mdc (1) (1) (2) (3) write to phy interface register mmd = 0 mdc = 1 1-bit data read timing relationship (3) write to phy interface register mmd = 0 mdc = 0 (2) read from phy interface register read mmd = 0 mmc = 1 mdi is read data mdi figure 12.6 (3) 1-bit data read flowchart
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 433 of 1262 rej09b0437-0100 mdc (1) (1) write to phy interface register mmd = 0 mdc = 0 independent bus release timing relationship mdo figure 12.6 (4) independent bus release flowchart (idle in write in figure 12.5) 12.4.5 magic packet detection the etherc has a magic packet detection function. this function provides a wake-on-lan (wol) facility that activates various peripheral devices connected to a lan from the host device or other source. this makes it possible to constr uct a system in which a peripheral device receives a magic packet sent from the host device or othe r source, and activates itself. when the magic packet is detected, data is stored in the fifo of the e-dmac by the broadcast packet that has received data previously and the etherc is notifie d of the receiving status . to return to normal operation from the interrupt processing, initialize the etherc and e-dmac by using the swr bit in the e-dmac mode register (edmr). with a magic packet, recep tion is performed regardless of the de stination address. as a result, this function is valid, and the wol pin enabled, only in the case of a match with the destination address specified by the format in the magic packet. further information on magic packets can be found in the technical documentation published by amd corporation. the procedure for using the wol func tion with this lsi is as follows. 1. disable interrupt source output by means of the various interrupt enable/mask registers. 2. set the magic packet detection enable bit (mpde) in the etherc mode register (ecmr). 3. set the magic packet detection interrupt enable bit (mpdip) in the etherc interrupt enable register (ecsipr) to the enable setting. 4. if necessary, set the cpu operating mode to sleep mode or set supporting functions to module standby mode. 5. when a magic packet is detected, an interrupt is sent to the cpu. the wol pin notifies peripheral lsis that the magic packet has been detected.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 434 of 1262 rej09b0437-0100 12.4.6 operation by ipg setting the etherc has a function to change the non-transmission period ipg (inter packet gap) between transmit frames. by changing the set values of th e ipg setting register (i pgr), the transmission efficiency can be raised and lowered from the st andard value. ipg settings are prescribed in ieee802.3 standards. when changing settings, ad equately check that th e respective devices can operate smoothly on the same network. ipg * [1] [2] [3] [4] [1] [2] [3] [4] [5] ...... ...... packet note: * ipg may be longer than the set value, depending on the state of the circuit and the system bus. case a (short ipg) case b (long ipg) figure 12.7 changing ipg and transmission efficiency 12.4.7 flow control the etherc supports flow control functions conforming to ieee802.3x in full-duplex operations. flow control can be applied to both receive and transmit operations. the me thods for transmitting pause frames when controlling flow are as follows: automatic pause frame transmission: for receive frames, pause frames are automatically transmitted when the number of da ta in the receive fifo (include d in e-dmac) reaches the value set in the flow control fifo threshold register (fcftr) of the e-dmac. the time parameter included in the pause frame at this time is set by the automatic pause frame setting register (apr). the automatic pause frame transmission is repeated until the number of data in the receive fifo becomes less than the fcftr setting as the receive data is read from the fifo. the upper limit of the number of retransfers of the pause frame can also be set by the automatic pause frame retransfer count set register (tpauser). in this case, pause frame transmission is repeated until the number of data becomes fcftr value set or below, or the number of transmits reaches the value se t by tpauser. the automatic pause frame transmission is enabled when the txf bit in the ethe rc mode register (ecmr) is 1.
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 435 of 1262 rej09b0437-0100 manual pause frame transmission: pause frames are transmitted by directives from the software. when writing the timer value to the ma nual pause frame set register (mpr), manual pause frame transmission is started. with this method, pause frame transmission is carried out only once. pause frame reception: the next frame is not transmitted until the time indicated by the timer value elapses after receiving a pause fram e. however, the transmission of the current frame is continued. a received pause frame is va lid only when the rxf bit in the etherc mode register (ecmr) is set to 1. 12.5 connection to phy-lsi figure 12.8 shows the example of connection to a dp83846avhg by national semiconductor corporation. tx-er mii_txd3 mii_txd2 mii_txd1 mii_txd0 tx-en tx-clk mdc mdio mii_rxd3 mii_rxd2 mii_rxd1 mii_rxd0 rx-clk crs col rx-dv rx-er tx_er txd3 txd2 txd1 txd0 tx_en tx_clk mdc mdio rxd3 rxd2 rxd1 rxd0 rx_clk crs col rx_dv rx_er dp83846avhg mii (media independent interface) this lsi figure 12.8 example of connection to dp83846avhg
section 12 ethernet controller (etherc) rev. 1.00 nov. 14, 2007 page 436 of 1262 rej09b0437-0100 12.6 usage notes ? conditions for setting lchng bit even if the level of the signal input to the lnksta pin is not changed, the lchng bit in ecsr may be set. it may happen when the pin function is changed from port to lnksta by pccrh2 of the pfc or when a software reset caused by the swr bit in edmr is cleared while the lnksta pin is being driven high. this is because the lnksta signal is internally fixed low when the pin functions as a port or during the software reset state regardless of the external pin level. clear the lchng bit before setting the lchngip bit in ecsipr not to request a link signal changed interrupt accidentally.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 437 of 1262 rej09b0437-0100 section 13 ethernet controller direct memory access controller (e-dmac) this lsi includes a direct memory access controlle r (e-dmac) directly conn ected to the ethernet controller (etherc). a large proportion of buffer management is controlled by the e-dmac itself using descriptors. this lightens the load on the cp u and enables efficient control of data transfer. figure 13.1 shows the configuration of the e-dmac, and the descriptors and transmit/receive buffers in memory. 13.1 features the e-dmac has the following features: ? the load on the cpu is reduced by means of a descriptor management system ? transmit/receive frame status inform ation is indicated in descriptors ? achieves efficient system bus utilization thro ugh the use of block transfer (16-byte units) ? supports single-frame/multi-buffer operation transmit fifo receive fifo transmit descriptor transmit buffer receive buffer receive descriptor external bus interface internal bus internal bus interface this lsi external memory etherc e-dmac descriptor information transmit dmac receive dmac descriptor information figure 13.1 configuration of e- dmac, and descriptors and buffers
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 438 of 1262 rej09b0437-0100 13.2 register descriptions the e-dmac has the following registers. for ad dresses and access sizes of these registers, see section 28, list of registers. ? e-dmac mode register (edmr) ? e-dmac transmit request register (edtrr) ? e-dmac receive request register (edrrr) ? transmit descriptor list address register (tdlar) ? receive descriptor list ad dress register (rdlar) ? etherc/e-dmac status register (eesr) ? etherc/e-dmac status interrupt permission register (eesipr) ? transmit/receive status copy enable register (trscer) ? receive missed-frame coun ter register (rmfcr) ? transmit fifo threshold register (tftr) ? fifo depth register (fdr) ? receiving method cont rol register (rmcr) ? e-dmac operation control register (edocr) ? receive buffer write ad dress register (rbwar) ? receive descriptor fetch address register (rdfar) ? transmit buffer read address register (tbrar) ? transmit descriptor fetch address register (tdfar) ? flow control fifo threshold register (fcftr) ? receive data padding set ting register (rpadir) ? transmit interrupt register (trimd) ? checksum mode register (csmr) ? checksum skipped bytes monitor register (cssbm) ? checksum monitor re gister (cssmr)
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 439 of 1262 rej09b0437-0100 13.2.1 e-dmac mode register (edmr) edmr is a 32-bit readable/writable register that specifies the operatin g mode of the e-dmac. the settings in this register are normally made in the initialization process following a reset. if the etherc and e-dmac are initialized by means of th is register during data transmission, abnormal data may be sent onto the line. operating mode settings must not be changed while the transmit and receive functions are enabled. to change the operating mode, the etherc and e-dmac modules are got into at their initial state by means of the software reset bit (swr) in this register, then make new settings. it takes 64 cycles of the internal bus clock b to initialize the etherc and e-dmac. therefore, registers of the etherc and e-dmac should be accessed after 64 cycles of the internal bus clock b has elapsed. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrr/wr/wr/wrrrr/w ???????????????? ????????? de dl1 dl0 ??? swr bit bit name initial value r/w description 31 to 7 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 6 de 0 r/w e-dmac data endian convert selects whether or not the endian format is converted on data transfer by the e-dmac. however, the endian format of the descriptors and e-dmac register values are not converted regardless of this bit setting. 0: endian format not converted (big endian) 1: endian format converted (little endian)
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 440 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 4 dl1 dl0 0 0 r/w r/w descriptor length these bits specify the descriptor length. 00: 16 bytes 01: 32 bytes 10: 64 bytes 11: reserved (setting prohibited) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 swr 0 r/w software reset writing 1 in this bit initializes registers of the e-dmac other than tdlar, rdlar, and rmfcr and registers of the etherc. while a software reset is being executed (64 cycles of the internal bus clock b ), accesses to the all ethernet-related registers are prohibited. software reset period (example): when b = 100 mhz: 0.64 s when b = 75 mhz: 0.85 s this bit is always read as 0. 0: writing 0 is ignored (e-dmac operation is not affected) 1: writing 1 resets the etherc and e-dmac and then automatically cleared
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 441 of 1262 rej09b0437-0100 13.2.2 e-dmac transmit request register (edtrr) the edtrr is a 32-bit readable/writable register that issues transmit directives to the e-dmac. when transmission of one frame is completed, the next descriptor is read. if the transmit descriptor active bit in this descriptor has the "active" setting, transmission is continued. if the transmit descriptor active bit has the "inactive" se tting, the tr bit is cleared and operation of the transmit dmac is halted. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr/w ???????????????? ??????????????? tr bit bit name initial value r/w description 31 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 tr 0 r/w transmit request 0: transmission-halted state. writing 0 does not stop transmission. termination of transmission is controlled by the active bit in the transmit descriptor 1: start of transmission. the relevant descriptor is read and a frame is sent with the transmit active bit set to 1
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 442 of 1262 rej09b0437-0100 13.2.3 e-dmac receive request register (edrrr) edrrr is a 32-bit readable/writable register that issues receive di rectives to the e-dmac. when the receive request bit is set, the e-dmac reads the relevant receive descriptor. if the receive descriptor active bit in the descriptor has the "ac tive" setting, the e-dmac prepares for a receive request from the etherc. when one receive buffer of data has been received, the e-dmac reads the next descriptor and prepares to receive the next frame. if the receive de scriptor active bit in the descriptor has the "inactive" setting, the rr bit is cleared and operation of the receive dmac is halted. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr/w ??????????????? ??????????????? ? rr bit bit name initial value r/w description 31 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 rr 0 r/w receive request 0: the receive function is disabled * 1: a receive descriptor is read and the e-dmac is ready to receive note: * if the receive function is disabled during fr ame reception, write-back is not performed successfully to the receive descriptor. follo wing pointers to read a receive descriptor become abnormal and the e-dmac cannot operate successfully. in this case, to make the e-dmac reception enabled again, execute a software reset by the swr bit in edmr. to make the e-dmac reception disabled without executing a software reset, set the re bit in ecmr. next, after the e_dmac has completed the reception and write-back to the receive descriptor has been confirmed, disable t he receive function of this register.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 443 of 1262 rej09b0437-0100 13.2.4 transmit descriptor li st address register (tdlar) tdlar is a 32-bit readable/writable register that specifies the start address of the transmit descriptor list. descriptors have a boundary configuration in accordance with the descriptor length indicated by the dl bit in edmr. this register must not be written to during transmission. modifications to this register should only be made while transmission is disabled by the tr bit ( = 0) in the e-dmac transmit request register (edtrr). 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w tdla[31:16] tdla[15:0] bit bit name initial value r/w description 31 to 0 tdla[31:0] all 0 r/w transmit descriptor start address the lower bits are set as follows according to the specified descriptor length. 16-byte boundary: tdla3 to tdla0 = 0000 32-byte boundary: tdla4 to tdla0 = 00000 64-byte boundary: tdla5 to tdla0 = 000000
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 444 of 1262 rej09b0437-0100 13.2.5 receive descriptor li st address register (rdlar) rdlar is a 32-bit readab le/writable register that specifies the start address of the receive descriptor list. descriptors have a boundary configuration in accordance with the descriptor length indicated by the dl bit in edmr. this register must not be written to during reception. modifications to this register should only be made while reception is disabled by the rr bit ( = 0) in the e-dmac receive request register (edrrr). 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w rdla[31:16] rdla[15:0] bit bit name initial value r/w description 31 to 0 rdla[31:0] all 0 r/w receive descriptor start address the lower bits are set as follows according to the specified descriptor length. 16-byte boundary: rdla3 to rdla0 = 0000 32-byte boundary: rdla4 to rdla0 = 00000 64-byte boundary: rdla5 to rdla0 = 000000
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 445 of 1262 rej09b0437-0100 13.2.6 etherc/e-dmac st atus register (eesr) eesr is a 32-bit readable/writable register that shows communications status information on the e-dmac in combination with the etherc. the informat ion in this register is reported in the form of interrupts. individual bits are cleared by writing 1 (however, bit 22 (eci) is a read-only bit and not to be cleared by writing 1) and are not affected by writing 0. each interrupt source can also be masked by means of the corresponding bit in the etherc/e-dmac status interrupt permission register (eesipr). the interrupts generated by this register are eint0. for interrupt priority, see section 6.5, interrupt exception handling vector table and priority. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r/w r r r r/w r/w r/w r/w r r/w r/w r/w r/w r/w r/w 0000000000000000 r r r r r/w r/w r/w r/w r/w r r r/w r/w r/w r/w r/w ? twb ??? tabt rabt rfcof ade eci tc tde tfuf fr rde rfof ???? cnd dlc cd tro rmaf ?? rrf rtlf rtsf pre cerf bit bit name initial value r/w description 31 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 30 twb 0 r/w write-back complete indicates that write-back from the e-dmac to the corresponding descriptor has completed. this operation is enabled when the tis bit in trimd is set to 1. 0: write-back has not completed, or no transmission directive 1: write-back has completed 29 to 27 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 446 of 1262 rej09b0437-0100 bit bit name initial value r/w description 26 tabt 0 r/w transmit abort detection indicates that frame transmission by the etherc has been aborted because of an error during transmission. 0: frame transmission has not been aborted or no transmit directive 1: frame transmit has been aborted 25 rabt 0 r/w receive abort detection indicates that frame recept ion by the etherc has been aborted because of an error during reception. 0: frame reception has not been aborted or no receive directive 1: frame receive has been aborted 24 rfcof 0 r/w receive frame counter overflow indicates that the receiv e fifo frame counter has overflowed. 0: receive frame counter has not overflowed 1: receive frame counter overflows 23 ade 0 r/w address error indicates that the memory address that the e-dmac tried to transfer is found illegal. 0: illegal memory address not detected (normal operation) 1: illegal memory address detected note: when an address error is detected, the e-dmac halts transmitting/receiving. to resume the operation, set the e-dmac again after software reset by means of the swr bit in edmr. 22 eci 0 r etherc status register interrupt source this bit is a read-only bit. when the source of an ecsr interrupt in the etherc is cleared, this bit is also cleared. 0: etherc status interrupt source has not been detected 1: etherc status interrupt source has been detected
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 447 of 1262 rej09b0437-0100 bit bit name initial value r/w description 21 tc 0 r/w frame transmit complete indicates that all the data specified by the transmit descriptor has been transmi tted to the etherc. the transfer status is written back to the relevant descriptor. when 1-frame transmission is completed for 1-frame/1-buffer processing, or when the last data in the frame is transmitted and the transmission descriptor valid bit (tact) in the next descriptor is not set for multiple-frame buffe r processing, transmission is completed and this bit is set to 1. after frame transmission, the e-dmac writes the transmission status back to the descriptor. 0: transfer not complete, or no transfer directive 1: transfer complete 20 tde 0 r/w transmit descriptor empty indicates that the transmission descriptor valid bit (tact) in the descriptor is not set when the e-dmac reads the transmission descriptor when the previous descriptor is not the last one of the frame for multiple- buffer frame processing. as a result, an incomplete frame may be transmitted. 0: transmit descriptor active bit tact = 1 detected 1: transmit descriptor active bit tact = 0 detected when transmission descriptor empty (tde = 1) occurs, execute a software reset and initiate transmission. in this case, the address that is stored in the transmit descriptor list address register (tdlar) is transmitted first. 19 tfuf 0 r/w transmit fifo underflow indicates that underflow has occurred in the transmit fifo during frame transmission. incomplete data is sent onto the line. 0: underflow has not occurred 1: underflow has occurred
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 448 of 1262 rej09b0437-0100 bit bit name initial value r/w description 18 fr 0 r/w frame reception indicates that a frame has been received and the receive descriptor has been updated. this bit is set to 1 each time a frame is received. 0: frame not received 1: frame received 17 rde 0 r/w receive descriptor empty when receive descriptor empty (rde = 1) occurs, receiving can be restarted by setting ract = 1 in the receive descriptor and initiating receiving. 0: receive descriptor active bit ract = 1 not detected 1: receive descriptor active bit ract = 0 detected 16 rfof 0 r/w receive fifo overflow indicates that the receive fifo has overflowed during frame reception. 0: overflow has not occurred 1: overflow has occurred 15 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 cnd 0 r/w carrier not detect indicates the carrier detection status. 0: a carrier is detected when transmission starts 1: a carrier is not detected when transmission starts 10 dlc 0 r/w detect loss of carrier indicates that loss of t he carrier has been detected during frame transmission. 0: loss of carrier not detected 1: loss of carrier detected 9 cd 0 r/w delayed collision detect indicates that a delayed collision has been detected during frame transmission. 0: delayed collision not detected 1: delayed collision detected
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 449 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 tro 0 r/w transmit retry over indicates that a retry-over condition has occurred during frame transmission. total 16 transmission retries including 15 retries based on the back-off algorithm are failed after the etherc transmission starts. 0: transmit retry-over condition not detected 1: transmit retry-over condition detected 7 rmaf 0 r/w receive multicast address frame 0: multicast address frame has not been received 1: multicast address frame has been received 6, 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 rrf 0 r/w receive residual-bit frame 0: residual-bit frame has not been received 1: residual-bit frame has been received 3 rtlf 0 r/w rece ive too-long frame indicates that the frame more than the number of receive frame length upper limit set by rflr of the etherc has been received. 0: too-long frame has not been received 1: too-long frame has been received 2 rtsf 0 r/w receive too-short frame indicates that a frame of fewer than 64 bytes has been received. 0: too-short frame has not been received 1: too-short frame has been received 1 pre 0 r/w phy receive error 0: phy receive error not detected 1: phy receive error detected 0 cerf 0 r/w crc error on received frame 0: crc error not detected 1: crc error detected
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 450 of 1262 rej09b0437-0100 13.2.7 etherc/e-dmac st atus interrupt permissi on register (eesipr) eesipr is a 32-bit readable/writable register that enables interrupts corresponding to individual bits in the etherc/e-dmac status register (eesr) . an interrupt is enabled by writing 1 to the corresponding bit. in the initial st ate, interrupts are not enabled. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r/w r r r r/w r/w r/w r/w r r/w r/w r/w r/w r/w r/w 0000000000000000 r r r r r/w r/w r/w r/w r/w r r r/w r/w r/w r/w r/w twbip ? ??? tabtip rabtip rfcof ip adeip eciip tcip tdeip tfufip frip rdeip rfofip ???? cndip dlcip cdip troip rmafip ?? rrfip rtlfip rtsfip preip cerfip bit bit name initial value r/w description 31 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 30 twbip 0 r/w write-back complete interrupt permission 0: write-back complete interrupt is disabled 1: write-back complete interrupt is enabled 29 to 27 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 26 tabtip 0 r/w transmit abort detection interrupt permission 0: transmit abort detection interrupt is disabled 1: transmit abort detection interrupt is enabled 25 rabtip 0 r/w receive abort detection interrupt permission 0: receive abort detection interrupt is disabled 1: receive abort detection interrupt is enabled 24 rfcofip 0 r/w receive frame count er overflow interrupt permission 0: receive frame counter overflow interrupt is disabled 1: receive frame counter overflow interrupt is enabled
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 451 of 1262 rej09b0437-0100 bit bit name initial value r/w description 23 adeip 0 r/w address error interrupt permission 0: address error interrupt is disabled 1: address error interrupt is enabled 22 eciip 0 r/w etherc status register interrupt permission 0: etherc status interrupt is disabled 1: etherc status interrupt is enabled 21 tcip 0 r/w frame transmit complete interrupt permission 0: frame transmit complete interrupt is disabled 1: frame transmit complete interrupt is enabled 20 tdeip 0 r/w transmit descriptor empty interrupt permission 0: transmit descriptor empty interrupt is disabled 1: transmit descriptor empty interrupt is enabled 19 tfufip 0 r/w transmit fifo underflow interrupt permission 0: underflow interrupt is disabled 1: underflow interrupt is enabled 18 frip 0 r/w frame received interrupt permission 0: frame received interrupt is disabled 1: frame received interrupt is enabled 17 rdeip 0 r/w receive descriptor empty interrupt permission 0: receive descriptor empty interrupt is disabled 1: receive descriptor empty interrupt is enabled 16 rfofip 0 r/w receive fifo overflow interrupt permission 0: receive fifo overflow interrupt is disabled 1: receive fifo overflow interrupt is enabled 15 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 cndip 0 r/w carrier not detect interrupt permission 0: carrier not detect interrupt is disabled 1: carrier not detect interrupt is enabled
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 452 of 1262 rej09b0437-0100 bit bit name initial value r/w description 10 dlcip 0 r/w detect loss of carrier interrupt permission 0: detect loss of carrier interrupt is disabled 1: detect loss of carrier interrupt is enabled 9 cdip 0 r/w delayed collision detect interrupt permission 0: delayed collision detect interrupt is disabled 1: delayed collision detect interrupt is enabled 8 troip 0 r/w transmit retry over interrupt permission 0: transmit retry over interrupt is disabled 1: transmit retry over interrupt is enabled 7 rmafip 0 r/w receive multicast address frame interrupt permission 0: receive multicast address frame interrupt is disabled 1: receive multicast address frame interrupt is enabled 6, 5 ? all 0 r reserved this bit is always read as 0. the write value should always be 0. 4 rrfip 0 r/w receive residual-bit frame interrupt permission 0: receive residual-bit frame interrupt is disabled 1: receive residual-bit frame interrupt is enabled 3 rtlfip 0 r/w receive too-l ong frame interrupt permission 0: receive too-long frame interrupt is disabled 1: receive too-long frame interrupt is enabled 2 rtsfip 0 r/w receive too-s hort frame interrupt permission 0: receive too-short frame interrupt is disabled 1: receive too-short frame interrupt is enabled 1 preip 0 r/w phy-lsi receive error interrupt permission 0: phy-lsi receive error interrupt is disabled 1: phy-lsi receive error interrupt is enabled 0 cerfip 0 r/w crc error on received frame 0: crc error on received frame interrupt is disabled 1: crc error on received frame interrupt is enabled
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 453 of 1262 rej09b0437-0100 13.2.8 transmit/receive status copy enable register (trscer) trscer specifies whether or not transmit and receive status information reported by bits in the etherc/e-dmac status register is to be indicated in bits tfs26 to tfs0 and rfs26 to rfs0 in the corresponding descriptor. bits in this register correspond to bits 11 to 0 in the etherc/e- dmac status register (eesr). when a bit is clear ed to 0, the transmit st atus (bits 11 to 8 in eesr) is indicated in bits tfs3 to tfs0 in the transmit descriptor, and the receive status (bits 7 to 0 in eesr) is indicated in bits rfs7 to rfs0 of the receive descriptor. when a bit is set to 1, the occurrence of the correspond ing interrupt is not indicated in the descriptor. after this lsi is reset, all bits are cleared to 0. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r r r/w r/w r/w r/w r/w r r r/w r/w r/w r/w r/w ???????????????? ???? cndce dlcce cdce troce rmaf ce ?? rrfce rtlf ce rtsf ce prece cerf ce bit bit name initial value r/w description 31 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 cndce 0 r/w cnd bit copy directive 0: indicates the cnd bit state in bit tfs3 in the transmit descriptor 1: occurrence of the corresponding interrupt is not indicated in bit tfs3 of the transmit descriptor 10 dlcce 0 r/w dlc bit copy directive 0: indicates the dlc bit state in bit tfs2 of the transmit descriptor 1: occurrence of the corresponding interrupt is not indicated in bit tfs2 of the transmit descriptor
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 454 of 1262 rej09b0437-0100 bit bit name initial value r/w description 9 cdce 0 r/w cd bit copy directive 0: indicates the cd bit state in bit tfs1 of the transmit descriptor 1: occurrence of the corresponding interrupt is not indicated in bit tfs1 of the transmit descriptor 8 troce 0 r/w tro bit copy directive 0: indicates the tro bit state in bit tfs0 of the receive descriptor 1: occurrence of the corresponding interrupt is not indicated in bit tfs0 of the receive descriptor 7 rmafce 0 r/w rmaf bit copy directive 0: indicates the rmaf bit state in bit rfs7 of the receive descriptor 1: occurrence of the corresponding interrupt is not indicated in bit rfs7 of the receive descriptor 6, 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 rrfce 0 r/w rrf bit copy directive 0: indicates the rrf bit state in bit rfs4 of the receive descriptor 1: occurrence of the corresponding interrupt is not indicated in bit rfs4 of the receive descriptor 3 rtlfce 0 r/w rtlf bit copy directive 0: indicates the rtlf bit stat e in bit rfs3 of the receive descriptor 1: occurrence of the corresponding interrupt is not indicated in bit rfs3 of the receive descriptor 2 rtsfce 0 r/w rtsf bit copy directive 0: indicates the rtsf bit state in bit rfs2 of the receive descriptor 1: occurrence of the corresponding interrupt is not indicated in bit rfs2 of the receive descriptor
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 455 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1 prece 0 r/w pre bit copy directive 0: indicates the prf bit state in bit rfs1 of the receive descriptor 1: occurrence of the corresponding interrupt is not indicated in bit rfs1 of the receive descriptor 0 cerfce 0 r/w cerf bit copy directive 0: indicates the cerf bit state in bit rfs0 of the receive descriptor 1: occurrence of the corresponding interrupt is not indicated in bit rfs0 of the receive descriptor 13.2.9 receive missed-fram e counter register (rmfcr) rmfcr is a 16-bit counter that indicates the number of frames missed (discarded, and not transferred to the receive buffer) during reception. when the recei ve fifo overflow s, the receive frames in the fifo are discarded. the number of frames discarded at this time is counted. when the value in this register reaches h'ffff, counting-up is halted. wh en this register is read, the counter value is cleared to 0. write operations to this register have no effect. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrr r ???????????????? mfc[15:0] bit bit name initial value r/w description 31 to 16 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 15 to 0 mfc[15:0] all 0 r missed-frame counter indicate the number of fr ames that are discarded and not transferred to the receive buffer during reception.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 456 of 1262 rej09b0437-0100 13.2.10 transmit fifo threshold register (tftr) tftr is a 32-bit readable/writable register that specifies the transmit fifo threshold at which the first transmission is started. the actual threshol d is 4 times the set value. the etherc starts transmission when the amount of data in the transmit fifo exceeds the number of bytes specified by this register, when the transmit fifo is full, or when 1-frame write is executed. when setting this register, do so in the transmission-halt state. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ???? ? ????? ??????????? tft[10:0] bit bit name initial value r/w description 31 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 10 to 0 tft[10:0] all 0 r/w transmit fifo threshold when setting a transmit fifo, the fifo must be set to a smaller value than the spec ified value of the fifo capacity by fdr. h'00: store and forward modes h'01 to h'0c: setting prohibited h'0d: 52 bytes h'0e: 56 bytes : : h'1f: 124 bytes h'20: 128 bytes : : h'3f: 252 bytes h'40: 256 bytes : : h'7f: 508 bytes h'80: 512 bytes h'81 to h'200: setting prohibited note: when starting transmission before one frame of data write has completed, take care the generation of the underflow.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 457 of 1262 rej09b0437-0100 13.2.11 fifo depth register (fdr) fdr is a 32-bit readable/writable register that specifies the depth of the transmit and receive fifos. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 151413121110987654321 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000100000001 rrrrrr/wr/wr/wrrrrrr/wr/w r/w    tfd2 tfd1 tfd0  rfd2 rfd1 rfd0 bit: initial value: r/w: bit: initial value: r/w: bit bit name initial value r/w description 31 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 10 9 8 tfd2 tfd1 tfd0 0 0 1 r/w r/w r/w transmit fifo depth these bits specify the dept h of the transmit fifo. after the start of the trans mission and reception, the setting cannot be changed. 000: 256 bytes 001: 512 bytes other than above: setting prohibited 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 1 0 rfd2 rfd1 rfd0 0 0 1 r/w r/w r/w receive fifo depth these bits specify the depth of the receive fifo. after the start of the transmission and reception, the setting cannot be changed. 000: 256 bytes 001: 512 bytes other than above: setting prohibited
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 458 of 1262 rej09b0437-0100 13.2.12 receiving method control register (rmcr) rmcr is a 32-bit readable/writable register that specifies the control me thod for the rr bit in edrrr when a frame is received. this register must be set during the receiving-halt state. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrr r/w ??????????????? ? ??????????????? rnc bit bit name initial value r/w description 31 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 rnc 0 r/w receive enable control 0: when reception of one frame is completed, the e- dmac writes the receive st atus into the descriptor and clears the rr bit in edrrr 1: when reception of one frame is completed, the e- dmac writes the receive st atus into the descriptor, reads the next descriptor, and prepares to receive the next frame
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 459 of 1262 rej09b0437-0100 13.2.13 e-dmac operation control register (edocr) edocr is a 32-bit readable/writable register that specifies the control methods used in e-dmac operation. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrr/wr/wr/w r ??????????????? ? ???????????? fec aec edh ? bit bit name initial value r/w description 31 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 fec 0 r/w fifo error control specifies e-dmac operation when transmit fifo underflow or receive fifo overflow occurs. 0: e-dmac operation continues when underflow or overflow occurs 1: e-dmac operation halts when underflow or overflow occurs 2 aec 0 r/w address error control indicates detection of an illegal memory address in an attempted e-dmac transfer. 0: illegal memory address not detected (normal operation) 1: e-dmac stops its operation due to illegal memory address detection note: to resume the operation, set the e-dmac again after software reset by means of the swr bit in edmr.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 460 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1 edh 0 r/w e-dmac halted 0: the e-dmac is operating normally 1: the e-dmac has been halted by nmi pin assertion. e-dmac operation is restarted by writing 0 0 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 13.2.14 receiving-buffer writ e address register (rbwar) rbwar stores the address of data to be written in the receiving buffer when the e-dmac writes data to the receiving buffer. which addresses in the receiving buffer are processed by the e- dmac can be recognized by monitoring addresses displayed in this register. the address that the e-dmac is actually processing may be differ ent from the value read from this register. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr rbwa[31:16] rbwa[15:0] bit bit name initial value r/w description 31 to 0 rbwa[31:0] all 0 r receiving-buffer write address these bits can only be read. writing is prohibited.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 461 of 1262 rej09b0437-0100 13.2.15 receiving-descriptor fe tch address register (rdfar) rdfar stores the descriptor star t address that is required when the e-dmac fetches descriptor information from the receiving descriptor. which receiving descriptor information is used for processing by the e-dmac can be recognized by monitoring addresses displayed in this register. the address from which the e-dmac is actually fetching a descriptor may be different from the value read from this register. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 0000000000000000 rdfa[31:16] rrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrr rdfa[15:0] bit bit name initial value r/w description 31 to 0 rdfa[31:0] all 0 r receiv ing-descriptor fetch address these bits can only be read. writing is prohibited. 13.2.16 transmission-buffer read address register (tbrar) tbrar stores the addres s of the transmission buffer when the e-dmac reads data from the transmission buffer. which addresses in the tran smission buffer are processed by the e-dmac can be recognized by monitoring addresses displayed in this register. the address from which the e-dmac is actually reading in the buffer may be different from the value read from this register. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 0000000000000000 tbra[31:16] rrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrr tbra[15:0] bit bit name initial value r/w description 31 to 0 tbra[31:0] all 0 r transmission-buffer read address these bits can only be read. writing is prohibited.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 462 of 1262 rej09b0437-0100 13.2.17 transmission-descriptor fetch address register (tdfar) tdfar stores the descriptor start address that is required when the e-dmac fetches descriptor information from the transmission descriptor. which transmission descriptor information is used for processing by the e-dmac can be recognized by monitoring addresses displayed in this register. the address from which the e-dmac is actually fetching a descriptor may be different from the value read from this register. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 0000000000000000 tdfa[31:16] rrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrr tdfa[15:0] bit bit name initial value r/w description 31 to 0 tdfa[31:0] all 0 r transmission-descriptor fetch address these bits can only be read. writing is prohibited. 13.2.18 flow control fifo threshold register (fcftr) fcftr is a 32-bit readable/writable register that se ts the flow control of the etherc (setting the threshold on automatic pause transmission). the threshold can be specified by the depth of the receive fifo data (rfd2 to rfd0) and the nu mber of receive frames (rff2 to rff0). the condition to start the flow control is decided by taking or operation on the two thresholds. therefore, the flow control by the two thresholds is independently started. when flow control is performed according to the rfd bits setting, if the setting is the same as the depth of the receive fifo specified by the fifo depth register (fdr), flow control is started when the remaining fifo is (fifo data ? 64) bytes. for instance, when rfd in fdr = 1 and rfd in fcftr = 1, flow control is started when (512 ? 64) bytes of data is st ored in the receive fifo. the value set in the rfd bits in this register should be equal to or less than those in fdr.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 463 of 1262 rej09b0437-0100 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000111 rrrrrrrrrrrrrr/wr/wr/w 0000000000000000 rrrrrrrrrrrrrr/wr/wr/w ????????????? rff[2:0] ????????????? rfd[2:0] bit: initial value: r/w: bit: initial value: r/w: bit bit name initial value r/w description 31 to 19 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 18 to 16 rff[2:0] 111 r/w receive fram e number flow control threshold 000: when one receive frame has been stored in the receive fifo 001: when two receive frames have been stored in the receive fifo : : 110: when seven receive frames have been stored in the receive fifo 111: when eight receive frames have been stored in the receive fifo 15 to 3 ? all 0 ? reserved these bits are always read as 0. the write value should always be 0. 2 to 0 rfd[2:0] 000 r/w receive byte flow control threshold 000: when (256 ? 64) bytes of data is stored in the receive fifo 001: when (512 ? 64) bytes of data is stored in the receive fifo other than above: setting prohibited
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 464 of 1262 rej09b0437-0100 13.2.19 receive data padding setting register (rpadir) rpadir is a 32-bit readable/writable register th at performs the padding of receive data. before setting this register again, reset the software with the swr bit in the e-dmac mode register (edmr). 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrr/wr/w 0000000000000000 rrrrrrrrrrr/wr/wr/wr/wr/wr/w ?????????????? pads1 pads0 ?????????? padr[5:0] bit bit name initial value r/w description 31 to 18 ? all 0 ? reserved these bits are always read as 0. the write value should always be 0. 17 16 pads1 pads0 0 0 r/w r/w padding size 00: no padding 01: padding of one byte 10: padding of two bytes 11: padding of three bytes 15 to 6 ? all 0 ? reserved these bits are always read as 0. the write value should always be 0. 5 to 0 padr[5:0] 000000 r/w padding range h'00: data equivalent to the padding size is inserted in the first byte. h'01: data equivalent to the padding size is inserted in the second byte. : : h'3e: data equivalent to the padding size is inserted in the 63rd byte. h'3f: data equivalent to the padding size is inserted in the 64th byte.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 465 of 1262 rej09b0437-0100 13.2.20 transmit interrupt register (trimd) trimd is a 32-bit readable/writable register that specifies whether or not to notify write-back completion for each frame using the twb bit in eesr and an in terrupt on transmit operations. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrr/rrrrrrrrr r/w ??????????????? ? ??????????????? tis bit bit name initial value r/w description 31 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 tis 0 r/w transmit interrupt setting 0: write-back completion for each frame is not notified 1: write-backed completion for each frame using the twb bit in eesr is notified 13.2.21 checksum mode register (csmr) csmr is a 32-bit readable/writable register that specifies the checksum operating mode. set this register when reception is stopped. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1100000000000000 r/wr/wrrrrrrrrrrrrrr 0000000000011010 rrrrrrrrrrr/wr/wr/wr/wr/wr/w csebl csmd ?????????????? ?????????? sb[5:0]
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 466 of 1262 rej09b0437-0100 bit bit name initial value r/w description 31 csebl 1 r/w operation setting fo r checksum calculation function 0: the result of checksum calculation is not written back to the receive descriptor. 1: the result of checksum calculation is written back to the receive descriptor. 30 csmd 1 r/w setting for checksum calculation mode 0: for all the data skipped from the beginning of packet, checksums are calculated on the bytes equivalent to the number of bytes specified in sb5 to sb0. 1: packet checksums are calculated along with the analysis of the tcp header. 29 to 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5 to 0 sb[5:0] * 011010 r/w bytes skipped in checksum calculation these bits specify the pos ition for starting checksum calculation from the beginning of a receive packet. if padding is used, include the padding size and the padding range when setting the position for starting checksum calculation. h'00: byte 0 (starting data) h'02: byte 2 : : h'1a: byte 26 : : h'3e: byte 62 note * setting is possible only when csebl = 1 and csmd = 0. otherwise, 6'h00 should be set.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 467 of 1262 rej09b0437-0100 13.2.22 checksum skipped bytes monitor register (cssbm ) cssbm is a 32-bit read-only register that stor es the number of skipped bytes during the processing of received packets in the e-dmac. the number of skipped bytes can be recognized by monitoring the value displayed by this register. note that the number of items of data received by the e-dmac may be different from the number of skipped bytes. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr ???????????????? ?????????? sbm[5:0] bit bit name initial value r/w description 31 to 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5 to 0 sbm[5:0] 000000 r/w number of skipped bytes these bits can only be read. writing is prohibited. these bits are initialized to 0 at the beginning of a receive packet. note * the value is valid only when csebl = 1 and csmd = 0.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 468 of 1262 rej09b0437-0100 13.2.23 checksum monitor register (cssmr) cssmr is a 32-bit read-only register that stores the value of a ch ecksum during the processing of received packets in e-dmac. the checksum value can be recognized by monitoring the value displayed by this register. note that the value of the data received by e-dmac may be different from the checksum value. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrr r ???????????????? cs[15:0] bit bit name initial value r/w description 31 to 16 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 15 to 0 cs[15:0] 0 r checksum value these bits can only be read. writing is prohibited. these bits are initialized to 0 at the beginning of a receive packet. note * the value is valid only when csebl = 1 and csmd = 0.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 469 of 1262 rej09b0437-0100 13.3 operation the e-dmac is connected to the etherc, and perfor ms efficient transfer of transmit/receive data between the etherc and memory (buffers) without the intervention of the cpu. the e-dmac itself reads control information, including buffer point ers called descriptors, re lating to the buffers. the e-dmac reads transmit data fr om the transmit buffer and writes receive data to the receive buffer in accordance with this control informat ion. by setting up a number of consecutive descriptors (a descriptor list), it is possible to execute transmission and reception continuously. 13.3.1 descriptor list and data buffers before starting transmission/recep tion, the communication program creates transmit and receive descriptor lists in memory. the start addresses of th ese lists are then set in the transmit and receive descriptor list start address registers. the descriptor start address must be aligned so that it matches the address boundary according to the descriptor length set by the e-dmac mode register (edmr). the transmit buffer start address can be aligned with a byte, a word, and a longword boundary. (1) transmit descriptor figure 13.2 shows the relationship between a transmit descriptor and the transmit buffer. according to the specification in this descriptor , the relationship betwee n the transmit frame and transmit buffer can be defined as one frame/one buffer or one frame/multi-buffer.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 470 of 1262 rej09b0437-0100 transmit descriptor transmit buffer valid transmit data t a c t t d l e t f p 1 t f p 0 tfs26 to tfs0 td0 tdl td1 tba padding (4 bytes) td2 31 30 29 28 27 26 0 t f e 31 16 31 0 figure 13.2 relationship between tr ansmit descriptor and transmit buffer
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 471 of 1262 rej09b0437-0100 (a) transmit descriptor 0 (td0) td0 indicates the transmit frame status. the cp u and e-dmac use td0 to report the frame transmission status. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w tact tdle tfp1 tfp0 tfe tfs[26:16] tfs[15:0] bit bit name initial value r/w description 31 tact 0 r/w transmit descriptor active indicates that this descriptor is active. the cpu sets this bit after transmit data has been transferred to the transmit buffer. the e-dmac resets this bit on completion of a frame transfer or when transmission is suspended. 0: the transmit descriptor is invalid. indicates that valid data has not been written to this bit by the cpu, or this bit has been reset by a write- back operation on termination of e-dmac frame transfer processing (completion or suspension of transmission) if this state is recognized in an e-dmac descriptor read, the e-dmac terminates transmit processing and transmit operations cannot be continued (a restart is necessary) 1: the transmit descriptor is valid. indicates that valid data has been written to the transmit buffer by the cpu and frame transfer processing has not yet been executed, or that frame transfer is in progress when this state is recognized in an e-dmac descriptor read, the e-dmac continues with the transmit operation
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 472 of 1262 rej09b0437-0100 bit bit name initial value r/w description 30 tdle 0 r/w transmit descriptor list end after completion of the co rresponding buffer transfer, the e-dmac references the first descriptor. this specification is used to set a ring configuration for the transmit descriptors. 0: this is not the last transmit descriptor list 1: this is the last transmit descriptor list 29 28 tfp1 tfp0 0 0 r/w r/w transmit frame position 1, 0 these two bits specify t he relationship between the transmit buffer and transmit frame. in the preceding and following descriptors, a logically positive relationship must be maintained between the settings of this bit and the tdle bit. 00: frame transmission for transmit buffer indicated by this descriptor continues (frame is not concluded) 01: transmit buffer indicated by this descriptor contains end of frame (frame is concluded) 10: transmit buffer indicated by this descriptor is start of frame (frame is not concluded) 11: contents of transmit buffer indicated by this descriptor are equivalent to one frame (one frame/one buffer) 27 tfe 0 r/w transmit frame error indicates that one or other bit of the transmit frame status indicated by bits 26 to 0 is set. whether or not the transmit frame status information is copied into this bit is specified by the tr ansmit/receive status copy enable register. 0: no error during transmission 1: an error occurred during transmission
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 473 of 1262 rej09b0437-0100 bit bit name initial value r/w description 26 to 0 tfs26 to tfs0 all 0 r/w transmit frame status tfs26 to tfs4: reserved (the write value should always be 0.) tfs8: detect transmit buffer underflow (corresponds to tde bit in eesr) tfs3: carrier not detect (corresponds to cnd bit in eesr) tfs2: detect loss of carrier (corresponds to dlc bit in eesr) tfs1: delayed collision detect (corresponds to cd bit in eesr) tfs0: transmit retry over (corresponds to tro bit in eesr)
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 474 of 1262 rej09b0437-0100 (b) transmit descriptor 1 (td1) td1 specifies the transmit buffer length (maximum 64 kbytes). 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr tdl[15:0] ???????????????? bit bit name initial value r/w description 31 to 16 tdl[15:0] all 0 r/w transmit buffer data length these bits specify the valid transfer byte length in the corresponding transmit buffer. when the one frame/multi-bu ffer system is specified (td0 and tfp = 10 or 00), the transfer byte length specified in the descriptors at the start and midway can be set in byte units. 15 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. (c) transmit descriptor 2 (td2) td2 specifies the 32-bit transmit buffer start addres s. the transmit buffer start address setting can be aligned with a byte, a word, or a longword boundary.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 475 of 1262 rej09b0437-0100 (2) receive descriptor figure 13.3 shows the relationshi p between a receive descriptor an d the receive buffer. in frame reception, the e-dmac performs data rewriting up to a receive buffe r 16-byte boundary, regardless of the receive frame length. finally, the actual receive frame length is reported in the lower 16 bits of rd1 in the descriptor. data transfer to the receive buffer is performed automatically by the e-dmac to give a one frame/one buffer or one frame/multi-buffer configuration according to th e size of one received frame. receive descriptor receive buffer valid receive data rfs9 to rfs0 rcs15 to rcs0 ract rdle rfp1 rfp0 rfe rd0 rbl rdl rd1 rba padding (4 bytes) rd2 31 30 29 28 27 26 25 1615 0 31 16 31 0 rcse 15 0 figure 13.3 relationship between receive descriptor and receive buffer
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 476 of 1262 rej09b0437-0100 (a) receive descriptor 0 (rd0) rd0 indicates the receive frame status. the cp u and e-dmac use rd0 to report the frame receive status. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w rcs[15:0] ract rdle rfp[1:0] rfe rcse rfs[9:0] bit bit name initial value r/w description 31 ract 0 r/w receive descriptor active indicates that this descriptor is active. the e-dmac resets this bit after receive data has been transferred to the receive buffer. on co mpletion of receive frame processing, the cpu sets this bit to prepare for reception. 0: the receive descriptor is invalid. indicates that the receive buffer is not ready (access disabled by e-dmac), or this bit has been reset by a write-back operation on termination of e- dmac frame transfer processing (completion or suspension of reception). if this state is recognized in an e-dmac descriptor read, the e-dmac terminates receive processing and receive operations cannot be continued. reception can be restarted by setting ract to 1 and executing receive initiation. 1: the receive descriptor is valid indicates that the receive buffer is ready (access enabled) and processing for frame transfer from the fifo has not been executed, or that frame transfer is in progress. when this state is recognized in an e-dmac descriptor read, the e-dmac continues with the receive operation.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 477 of 1262 rej09b0437-0100 bit bit name initial value r/w description 30 rdle 0 r/w receive descriptor list last after completion of the co rresponding buffer transfer, the e-dmac references the first receive descriptor. this specification is used to set a ring configuration for the receive descriptors. 0: this is not the last receive descriptor list 1: this is the last receive descriptor list 29, 28 rfp[1:0] 00 r/w receive frame position these two bits specify t he relationship between the receive buffer and receive frame. 00: frame reception for receive buffer indicated by this descriptor continues (frame is not concluded) 01: receive buffer indicated by this descriptor contains end of frame (frame is concluded) 10: receive buffer indicated by this descriptor is start of frame (frame is not concluded) 11: contents of receive buffer indicated by this descriptor are equivalent to one frame (one frame/one buffer) 27 rfe 0 r/w receive frame error indicates that one or other bit of the receive frame status indicated by bits 25 to 16 is set. whether or not the receive frame status information is copied into this bit is specified by the tr ansmit/receive status copy enable register. 0: no error during reception 1: a certain kind of error occurred during reception 26 rcse 0 r/w determination of receive packet checksum value when csebl = 1 and csmd = 1, the setting shown in table 13.1 occurs depending on the received packet and data. the information in this bit will be invalid if operation is based on any setting other than the above.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 478 of 1262 rej09b0437-0100 bit bit name initial value r/w description 25 to 16 rfs[9:0] all 0 r/ w receive frame status these bits indicate the error status during frame reception. rfs9: receive fifo overflow (corresponds to rfof bit in eesr) rfs8: reserved (the write value should always be 0.) rfs7: multicast address frame received (corresponds to rmaf bit in eesr) rfs6: cam entry unregistered frame received (corresponds to the ruaf bit in eesr) rsf5: reserved (the write value should always be 0.) rfs4: receive residual-bit frame error (corresponds to rrf bit in eesr) rfs3: receive too-long frame error (corresponds to rtlf bit in eesr) rfs2: receive too-short frame error (corresponds to rtsf bit in eesr) rfs1: phy-lsi receive error (corresponds to pre bit in eesr) rfs0: crc error on received frame (corresponds to cerf bit in eesr) 15 to 0 rcs[15:0] all 0 r/w receive packet checksum value
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 479 of 1262 rej09b0437-0100 table 13.1 types of receive packets and the rcse state of receive data frame type when data is no rmal when data is abnormal ip version option and extension header rcs[15:0] rcse rcs[15:0] rcse none 16'hffff 16'h0000 0 undefined 1 fragment undefined undef ined undefined undefined ipv4 option 16'hffff 16'h0000 0 undefined 1 none 16'hffff 16'h0000 0 undefined 1 hop-by-hop 16'hffff 16'h0000 0 undefined 1 routing 16'hffff 16'h0000 0 undefined 1 end-point option 16'hffff 16'h0000 0 undefined 1 ah 16'hffff 16'h0000 0 undefined 1 fragment undefined undef ined undefined undefined esp 16'h0000 1 16'h0000 1 mobileipv6 16'h0000 1 16'h0000 1 ipv6 others 16'h0000 1 16'h0000 1 other than ipv4 and ipv6 16'h0000 0 16'h0000 0
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 480 of 1262 rej09b0437-0100 (b) receive descriptor 1 (rd1) rd1 specifies the receive buffer length (maximum 64 kbytes). 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w rdl[15:0] rbl[15:0] bit bit name initial value r/w description 31 to 16 rbl[15:0] all 0 r/w receive buffer length these bits specify the maximum reception byte length in the corresponding receive buffer. the transfer byte length must align with a 16-byte boundary (bits 19 to 16 cleared to 0). the maximum receive frame length with one frame per buffer is 1,514 bytes, excluding the crc data. therefore, for the receive buffer length spec ification, a value of 1,520 bytes (h'05f0) that takes account of a 16-byte boundary is set as the maximum receive frame length. 15 to 0 rdl[15:0] all 0 r/w receive data length these bits specify the data length of a receive frame stored in the receive buffer. the receive data transferred to the receive buffer does not include the 4-byte crc data at the end of the frame. the receive frame length is reported as the number of words (valid data bytes) not including this crc data. (c) receive descriptor 2 (rd2) rd2 specifies the 32-bit receive buffer start address. the re ceive buffer start address must be aligned with a longword boundary. however, when sdram is connected, it must be aligned with a 16-byte boundary.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 481 of 1262 rej09b0437-0100 13.3.2 transmission when the transmit function is enabled and the tr ansmit request bit (tr) is set in the e-dmac transmit request register (edtrr), the e-dmac re ads the descriptor used last time from the transmit descriptor list (in the initial state, the de scriptor indicated by the transmission descriptor start address register (tdlar)). if the setting of th e tact bit in the read descriptor is active, the e-dmac reads transmit frame data sequentially from the transmit buffer start address specified by td2, and transfers it to the etherc. the etherc creates a transmit frame and starts transmission to the mii. after dma transfer of data equivalent to the buffer length speci fied in the descriptor, the following processing is carried out according to the tfp value. 1. tfp = 00 or 01 (frame continuation): descriptor write-back is performed after dma transfer. 2. tfp = 01 or 11 (frame end): descriptor write-back is performed after completion of frame transmission. the e-dmac continues reading descriptors and transmitting frames as long as the setting of the tact bit in the read descriptors is "active." when a descriptor with an "inactive" tact bit is read, the e-dmac resets the transmit request bit (t r) in the transmit register and ends transmit processing (edtrr).
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 482 of 1262 rej09b0437-0100 this lsi + memory transmission flowchart e-dmac etherc ethernet transmit fifo etherc/e-dmac initialization descriptor and transmit buffer setting transmit directive descriptor read descriptor write-back descriptor write-back transmission completed descriptor read transmit data transfer frame transmission transmit data transfer figure 13.4 sample transmission flowchart
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 483 of 1262 rej09b0437-0100 13.3.3 reception when the receive function is enabled and the cp u sets the receive request bit (rr) in the e- dmac receive request register (edrrr), the e-dmac reads th e descriptor following the previously used one from the receive descriptor list (the descriptor indicated by the receive descriptor list's starting address register (rdla) is used at the initial state), and then enters the receive-standby state. if the setting of the ract bit is "active" and an own-address frame is received, the e-dmac transfers the frame to the receive buffer specified by rd2. if the data length of the received frame is greater than the buffer length given by rd1, the e-dmac performs write-back to the descriptor when the buffer is full (rfp = 10 or 00), then reads the next descriptor. the e-dmac then continues to transfer data to the receive buff er specified by the new rd2. when frame reception is co mpleted, or if frame reception is suspended because of a certain kind of error, the e-dmac performs write-back to the relevant descriptor (rfp = 11 or 01), and then ends the receive processing. the e-dmac th en reads the next descriptor and enters the receive-standby state again. to receive frames continuously, the receive enable control bit (rnc) must be set to 1 in the receive control register (rcr). after in itialization, this bit is cleared to 0.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 484 of 1262 rej09b0437-0100 this lsi + memory reception flowchart e-dmac etherc receive fifo ethernet etherc/e-dmac initialization descriptor and receive buffer setting reception completed receive data transfer receive data transfer frame reception start of reception descriptor read descriptor write-back descriptor write-back descriptor read (receive ready for the next frame) descriptor read figure 13.5 sample reception flowchart
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 485 of 1262 rej09b0437-0100 13.3.4 multi-buffer frame tr ansmit/receive processing multi-buffer frame transmit processing if an error occurs during multi-buffer frame transmission, the processing shown in figure 13.6 is carried out by the e-dmac. where the transmit descriptor is shown as inactiv e (tact bit = 0) in the figure, buffer data has already been transmitted normally, and where the tr ansmit descriptor is shown as active (tact bit = 1), buffer data has not been transmitted. if a fr ame transmit error occurs in the first descriptor part where the transmit descriptor is active (tact bit = 1), transmission is halted, and the tact bit cleared to 0, immediately. the next descriptor is then read, and the position within the transmit frame is determined on the basis of bits tfp1 and tfp0 (continuing [b'00] or end [b'01]). in the case of a continuing descriptor, the tact bit is cleared to 0, only, and the next descriptor is read immediately. if the descriptor is the final descriptor, not only is the tact bit cleared to 0, but write-back is also performed to the tfe and tfs bits at the same time. data in the buffer is not transmitted between the occurrence of an error and write-back to th e final descriptor. if error interrupts are enabled in the etherc/e-dmac status interrupt permission register (eesipr), an interrupt is generated immediately after the final descriptor write-back. 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 e-dmac inactivates tact (change 1 to 0) descriptor read inactivates tact descriptor read inactivates tact descriptor read inactivates tact descriptor read inactivates tact and writes tfe, tfs descriptors untransmitted data is not transmitted after error occurrence descriptor is only processed. one frame buffer transmitted data untransmitted data transmit error occurrence t a c t t d l e t f p 1 t f p 0 figure 13.6 e-dmac oper ation after transmit error
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 486 of 1262 rej09b0437-0100 multi-buffer frame receive processing if an error occurs during multi-buffer frame reception, the processing shown in figure 13.7 is carried out by the e-dmac. where the receive descriptor is shown as inactive (ract bit = 0) in the figure, buffer data has already been received normally, and where the recei ve descriptor is shown as active (ract bit = 1), this indicates a buffer for which reception has no t yet been performed. if a frame receive error occurs in the first descriptor part where the ract bit = 1 in the figure, reception is halted immediately and a status write-back to the descriptor is performed. if error interrupts are enabled in the etherc/e -dmac status interrupt permission register (eesipr), an interrupt is generated immediately after the write-back. if there is a new frame receive request, reception is continued from th e buffer after that in which the error occurred. e-dmac inactivates ract and writes rfe, rfs descriptor read write-back descriptors buffer received data unreceived data receive error occurrence . . . . . . . . . start of frame new frame reception continues from buffer 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 r a c t r d l e r f p 1 r f p 0 figure 13.7 e-dmac oper ation after receive error
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 487 of 1262 rej09b0437-0100 13.3.5 padding receive data the e-dmac can pad one to three by tes anywhere in the receive data to increase the efficiency of processing of receive data. for example, by padding two bytes af ter the 14-byte mac header of an ethernet frame with this func tion, the subsequent data can be placed at the beginning of the four-byte boundary. [no padding] receive buffer area 16-byte boundary padding for separation in the 16-byte boundary 4 bytes mac header (14 bytes) mac header (14 bytes) mac header (14 bytes) 16-byte boundary 16-byte boundary padding for separation in the 16-byte boundary [padding] receive buffer area padding of two bytes after the 14th byte 16-byte boundary padding two bytes after the mac header 4 bytes mac header (14 bytes) mac header (14 bytes) mac header (14 bytes) 16-byte boundary 16-byte boundary figure 13.8 padd ing receive data
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 488 of 1262 rej09b0437-0100 13.3.6 checksum calculation function the tcp checksum for receive packets is accelerat ed when the checksum cal culation function is used in the following two modes: ? checksum calculation function of tcp header analysis type ? all-data checksum calculation function of skipped bytes designation type (1) checksum calculation function of tcp head er analysis type (csebl = 1 and csmd = 1) any receive packet included in the table below will be the target of calculation. ipver item no option option provided ipv4 fragment*1 no extension header length of the extension hea der of a hop-by-hop option length of the extensio n header of routing length of the extension header of a fragment*1 length of the extension hea der of an end-point option length of the extension header of ah length of the extens ion header of esp*2 ipv6 length of the extension header of mobileipv6*2 notes: * 1. this is the target of calculation, but both rcs15 to rcs0 and rcse will be undefined even if the data is normal. * 2. no calculation is performed on rcs15 to rcs0, and rcse is set to 1. the following shows the areas as th e target of calculation of an ip v4 packet. the shaded portions are the target of calculation.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 489 of 1262 rej09b0437-0100 0 packet length ipv4/ipv6/others (decision) ihl * an option, if any, is deleted from the target of calculation. data receive ip transmit ip receive ip transmit ip no. 31 16 15 11 8 7 0 1 2 3 4 5 6 7 8 9 10 note: * this is changed to the octet basis and undergoes a subtraction during checksum calculation. during calculation, {8'h00, protocol no.[7:0]} is used. the following shows the areas as th e target of calculation of an ip v6 packet. the shaded portions are the target of calculation.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 490 of 1262 rej09b0437-0100 0 next header * 1 next header * 1 header length * 2 ipv4/ipv6/others (decision) payload length the content of an extension header is not the target of checksum calculation. data receive ip transmit ip receive ip transmit ip transmit ip transmit ip transmit ip transmit ip transmit ip transmit ip no. 31 16 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 note: 1. calculation applies only to tcp/udp. calculation requires an expansion to {8'h00, next header[7:0]}. 2. this is changed to the octet basis and undergoes a subtraction during checksum calculation. (2) all-data checksum calcul ation function of skipped bytes designation type the data equivalent to the number of bytes specified by sb5 to sb0 is skipped from the beginning of a packet, and checksums are calculated on all of the subsequent valid data. (example: 14-byte skip) 0 data to be calculated sb[5:0]oe no. 31 16 15 0 1 2 3 4 5 6 7 8 9 10 11
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 491 of 1262 rej09b0437-0100 13.3.7 usage notes when the checksum calculation and padding functio ns are both enabled, checksums are calculated on the packet data available before padding. this should be remembered when, for example, setting the number of skipped bytes.
section 13 ethernet controller direct memory access controller (e-dmac) rev. 1.00 nov. 14, 2007 page 492 of 1262 rej09b0437-0100
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 493 of 1262 rej09b0437-0100 section 14 dmac that work s with encryption/decryption and forward error correction core (a-dmac) 14.1 overview the a-dmac is a high-level descriptor-mode dmac having error correction function. this dmac provides data transfer with memory via an internal shared bus ( i-bus) and data transfer with an external mpeg device via stif. 14.1.1 features the functions and features of this a-dmac are as follows: (1) channels for checksum processing ? number of channels: 2 ? transfer direction: memory memory, memory stif ? descriptor structure: structur e that enables checksum operati on, etc., to be continuously performed ? error check: checksum calculation function (2) fec channels ? number of channels: 1 ? descriptor structure: structure that enables processing of any number of data items with a small number of buffers ? error correction (fec): xor calculation function (3) other features ? supported endian: big endian/little endian ? number of stifs connected: two channels ? channel arbitration: round robin scheduling that provides highly efficient use of encryption modules and buses ? channel operation: parallel processing
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 494 of 1262 rej09b0437-0100 14.1.2 overall configuration of the a-dmac the a-dmac is configured as shown in figure 14.1. table 14.2 gives an overview of a-dmac submodules. the a-dmac is connected to the i-bus via th e i-bus interface, to the stif0 via the stif0 interface, and to the stif1 via the stif1 interface. the i-bus is a shared bus in this lsi operating on the b clock. the stif is an i/o port for mpeg-2 ts/ps format data. the stif0 is fixed at ch0 and the stif1 fixed at ch1. the a-dmac has two channels for checksum operation that operate on descriptors. aside from these channels, the a-dmac has an fec channel dedicated for fec operation. this fec channel performs xor operation of fec operation. these modules operate in para llel. for example, when the bus for channel 0 for checksum processing is accessed, channel 1 for checksu m processing can perfor m checksum op eration. the arbiter is a module that ar bitrates the requests sent from each checksum processing channel and each initiator of the fe c channel. the arbiter arbitrates re quests from an in itiator in round robin scheduling. if you want to execute ch0 and ch1 simultaneously and raise the priority of ch0 or ch1, the arbiter controls the priorities in descriptor ring units (example: when the descriptor of ch0 or ch1, whichever has a lower priority, runs dry, the arbiter piles up the next descriptor after a certain idling) or controls th e priorities by suspending channel processing of lower priority.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 495 of 1262 rej09b0437-0100 a-dmac cpu control channel0 control bus i/f control bus i/f data i-bus control intc stif0 stif1 arbiter function arbitration i-bus channel 0 for checksum function function dma automatic processing checksum operation processing data management, data selector channel 1 for checksum dma automatic processing checksum operation processing data management, data selector function i-bus interface bus protocol conversion stif0 interface stif0 protocol conversion stif1 interface stif1 protocol conversion function function function fec channel dma autmatic processing xor operation i-bus data stif0control stif0 data stif1 control stif1 data stif0 i/f control stif0 i/f data stif1 i/f control stif1 i/f data channel0 data channel1 control channel1 data fec channel control fec c hannel data cpu control data adma interrupt ad_irqc0_n ad_irqc1_n ad_irqfec_n x_rst x_bck x_bckstp_p x_modstp_p figure 14.1 block diagram of a-dmac
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 496 of 1262 rej09b0437-0100 table 14.1 a-dmac submodules submodule name function channel for checksum processing ? dma automatic processing based on descriptors ? checksum operation ? continuous execution of checksum fec channel ? dma automatic processing based on descriptors ? xor operation for any number of data items arbiter ? arbitrates requests from the channel for checksum processing and fec channel. ? channel arbitration mode is round robin scheduling. i-bus interface ? conversion between i-bus protocol and a-dmac protocol ? distribution of register r/w requests from the cpu to each module stif interface ? conversion between stif protocol and a-dmac protocol ? stif0 is fixed at channel 0 for encryption/authentication. ? stif1 is fixed at channel 1 for encryption/authentication.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 497 of 1262 rej09b0437-0100 14.1.3 restrictions on the a-dmac the following restrictions apply to the a-dmac: ? the a-dmac supports only register access in 32-bit units. ? if the channel processor, or fec processor is running, write to registers related to the appropriate processor is inhibited. however, you can write data to the following two registers by verifying them after the write even if the appropriate processor is running. write data repeatedly till verify succeeds. ? channel [i] processing control register (c[i]c ) (however, do not rewrite the c[i]c_r bit of the running channel processor.) ? channel [i] processing interrupt request register (c[i]i) ? descriptors of data size 0 are inhibited.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 498 of 1262 rej09b0437-0100 14.2 register descriptions the a-dmac has the following registers. for deta ils on the addresses of these registers and the register status in each processing stat e, see section 28, li st of registers. ? channel [i] processing control register (c[i]c) (i = 0, 1) ? channel [i] processing mode register (c[i]m) (i = 0, 1) ? channel [i] processing interrupt request register (c[i]i) (i = 0, 1) ? channel [i] processing descriptor start address register (c[i]dsa) (i = 0, 1) ? channel [i] processing descriptor current address register (c[i]dca) (i = 0, 1) ? channel [i] processing descriptor 0 register (c[i]d0) [control] (i = 0, 1) ? channel [i] processing descriptor 1 register (c[i]d1) [source address] (i = 0, 1) ? channel [i] processing descriptor 2 register (c[i]d2) [destination address] (i = 0, 1) ? channel [i] processing descriptor 3 register (c[i]d3) [data length] (i = 0, 1) ? channel [i] processing descriptor 4 register (c[i]d4) [checksum value write address] (i = 0, 1) ? fec dmac processing control register (fecc) ? fec dmac processing interrupt request register (feci) ? fec dmac processing descriptor start address register (fecdsa) ? fec dmac processing descriptor current address register (fecdca) ? fec dmac processing descriptor 0 register (fecd00) [control] ? fec dmac processing descriptor 1 register (fecd01d0a) [destination address] ? fec dmac processing descriptor 2 register (fecd02s0a) [source 0 address] ? fec dmac processing descriptor 3 register (fecd03s1a) [source 1 address]
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 499 of 1262 rej09b0437-0100 14.2.1 channel [i] pro cessing control register (c[i]c) (i = 0, 1) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr/w 0000000000000000 rrrrrrrr/wrrrr/wrrrr/w ??????????????? ??? c[i]c_ dwf ??? c[i]c_ vld ??? c[i]c_ eie ??? c[i]c_r c[i]c_e bit bit name initial value r/w description 31 to 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 c[i]c_r 0 r/w reset writing 1 to this bit when the channel [i] processor is halted causes the channel [i] calculation sequence to be reset. this bit is automatically and immediately set to 0. setting both this bit and the c[i]c_e bit to 1 causes channel [i] processing to be newly started. 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 c[i]c_dwf 0 r wait state flag after descriptor processing end 0: non-wait state 1: wait state there are two methods for understanding the processing state of the dmac channel [i] descriptor. in one, when the dmac channel [i] descriptor is set, c[i]dwe is set to 1 and then c[i]die is set to 1 to accept the "1 descriptor processing end" interrupt request. in the other, t he processing state is observed till this bit is set to 1. 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 500 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 c[i]c_vld 0 r/w variable-length descriptor control flag 0: fixed-length descriptor (32 bytes) 1: variable-length descriptor (16/32 bytes) the a-dmac channel uses the 32-byte fixed length structure or 16/32-byte vari able-length structure. if this bit is set to 0 to define the descriptor as the fixed-length, the descriptor is always read as 32 bytes. if this bit is set to 1 to define the descriptor as the variable-length, the first 16 bytes are read, and if r_cid4/r_cid5/r_cid6/r_cid7 information is required, the remaining 16 bytes are read according to the contents of r_cidm/r_cihm. 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 c[i]c_eie 0 r/w "processing end" interrupt request enable when processing ends, specifies whether to enable or disable the "processing end" interrupt request. 0: disables the "processing end" interrupt request. 1: enables the "processing end" interrupt request. a-dmac channel [i] processing end means fetching of depleted descriptors (invalid descriptors (descriptors where c[i]f0 is set to 0)). 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 501 of 1262 rej09b0437-0100 bit bit name initial value r/w description 0 c[i]c_e 0 r/w execution request setting this bit to 1 causes channel [i] processing to be started. setting this bit to 0 causes channel [i] processing to be suspended. when 0 is written to this bit, 0 is read immediately but the channel [i] processor does not stop imm ediately. that is, the processor stops after it writes back to the descriptor being processed. to understand the channel operating state, set the c[i] c_eie bit to 1 to accept the "operation end" interrupt request or poll the "operation end" interrupt request flag. to start new processing, the channel [i] of the stif must be initialized. 0: channel [i] processing is halted. 1: channel [i] processing is in progress. determine if channel [i] processing is suspended when the processor writes back to the descriptor.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 502 of 1262 rej09b0437-0100 14.2.2 channel [i] processing mode register (c[i]m) (i = 0, 1) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrr/wrrrr ??????????????? ??????????? c[i]m_ lie ??? ? ? bit bit name initial value r/w description 31 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 c[i]m_lie 0 r/w "last data desc riptor end processing" interrupt request enable when last data (c[i]f2=1) descriptor end processing ends, specifies whether to enable or disable the interrupt request. 0: disables the "last data descriptor processing end" interrupt request. 1: enables the "last data descriptor processing end" interrupt request. 3 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 503 of 1262 rej09b0437-0100 14.2.3 channel [i] processing interrupt request register (c[i]i) (i = 0, 1) ad_irqc[i]_n is asserted as negation of logical or of all bits in this register. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r r/w r r r r/w r r r r r r r r/w ??????????????? ??? c[i]i_ di ??? c[i]i_ li ??????? ? c[i]i_ ei bit bit name initial value r/w description 31 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 c[i]i_di 0 r/w "1 descriptor processing end" interrupt request (interrupt request to notif y you that the processor ended descriptor processing and wrote back the descriptor) this bit is cleared to 0 by writing 1 to it. when 0 is written to this bit, the current state is retained. 0: the "1 descriptor processing end" interrupt is not requested. 1: the "1 descriptor processing end" interrupt is requested. 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 504 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 c[i]i_li 0 r/w "continuous data last descriptor processing end" interrupt request (interrupt request to notify you that processing described in the descriptor where c[i]f2 is set to 1 ended) this bit is cleared to 0 by writing 1 to it. when 0 is written to this bit, the current state is retained. 0: the "last descriptor processing end" interrupt is not requested. 1: the "last descriptor processing end" interrupt is requested. 7 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 c[i]i_ei 0 r/w "processing end" interrupt request this bit indicates whether the "processing end" interrupt is requested. this bit is cleared to 0 by writing 1 to it. when 0 is written to this bit, the current state is retained. 0: the "processing end" in terrupt is not requested. 1: the "processing end" interrupt is requested. "processing end" means fetching of depleted descriptors (invalid descriptors (descriptors where c[i]f0 is set to 0)).
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 505 of 1262 rej09b0437-0100 14.2.4 channel [i] processing descriptor start address register (c[i]dsa) (i = 0, 1) do not write any value to this regi ster when c[i]c_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r r r r c[i]dsa[3:0] c[i]dsa[31:16] c[i]dsa[15:4] bit bit name initial value r/w description 31 to 4 c[i]dsa[31:4] all 0 r/w 3 to 0 c[i]dsa[3:0] all 0 r descriptor ring start address specify a descriptor ring start address. set a 16-byte boundary address value.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 506 of 1262 rej09b0437-0100 14.2.5 channel [i] processing descriptor current address re gister (c[i]dca) (i = 0, 1) do not write any value to this regi ster when c[i]c_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r r r r c[i]dca[3:0] c[i]dca[31:16] c[i]dca[15:4] bit bit name initial value r/w description 31 to 4 c[i]dca[31:4] all 0 r/w 3 to 0 c[i]dca[3:0] all 0 r descriptor current address specify the start address of descriptor processing. set a 16-byte boundary address value. when descriptor processing is in progress, these bits indicate the address of descriptor currently being processed. after descriptor write-back, these bits indicate the address of the next descriptor.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 507 of 1262 rej09b0437-0100 14.2.6 channel [i] processing descriptor 0 register (c[i]d0) [control] (i = 0, 1) do not write any value to this regi ster when c[i]c_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w c[i]crdo[3:0] c[i]chdo[3:0] c[i]so[3:0] c[i]da c[i]sa c[i]csm[1:0] ????????????? c[i]f2 c[i]f1 c[i]f0 bit bit name initial value r/w description 31 to 28 c[i]crdo[3:0] all 0 r/w transfe r data destination data sequence specify a swap method for writing transfer data after encryption processing from the a-dmac to memory such as the stif and sdram or after checksum operation. specify a swap method for writing the checksum operation result obtained from body data in the c[i]chdo3 to c[i] chdo0 bits, not these bits.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 508 of 1262 rej09b0437-0100 bit bit name initial value r/w description 31 to 28 c[i]crdo[3:0] all 0 r/w ? when the destination is not the stif (c[i]da bit = 0) c[i]crdo3: data swap in two-byte units (longword swap in word units) 0: as-is 1: swap c[i]crdo2: data swap in one-byte units (word swap in byte units) 0: as-is 1: swap c[i]crdo1: inversion of bit 1 at address when one or two bytes are accessed 0: as-is 1: inversion c[i]crdo0: inversion of bit 0 at address when one byte is accessed 0: as-is 1: inversion c[i]crdo1 and c[i]crdo0 function for endian adjustment. note that if an endian different from the endian of this lsi is used, up to three different addresses are accessed from the address where the start and end addresses are specified when an area is allocated. ? when the destination is the stif (c[i]da bit = 1) c[i]crdo3: data swap in two-byte units (longword swap in word units) 0: as-is 1: swap c[i]crdo2: data swap in one-byte units (word swap in byte units) 0: as-is 1: swap c[i]crdo1: data swap in one-bit units (byte swap in one-bit units) 0: as-is 1: swap c[i]crdo0: set this bit to 0 as reserved.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 509 of 1262 rej09b0437-0100 bit bit name initial value r/w description 27 to 24 c[i]chdo[3:0] all 0 r/w checksum operation result destination data sequence specify a swap method for writing the checksum operation result from the a-dmac to memory such as sdram. specify a swap method for writing body data after checksum operatio n in the c[i]crdo3 to c[i]crdo0 bits. c[i]chdo3: data swap in two-byte units (longword swap in word units) 0: as-is 1: swap c[i]chdo2: data swap in one-byte units (word swap in byte units) 0: as-is 1: swap c[i]chdo1: inversion of bit 1 at address when one or two bytes are accessed 0: as-is 1: inversion c[i]chdo0: inversion of bit 0 at address when one byte is accessed 0: as-is 1: inversion c[i]chdo1 and c[i]chdo0 function for endian adjustment. note that if an endian different from the endian of this lsi is used, up to three different addresses are accessed from the address where the start and end addresses are specified when an area is allocated.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 510 of 1262 rej09b0437-0100 bit bit name initial value r/w description 23 to 20 c[i]so[3:0] all 0 r/w source data sequence specify a swap method for reading data from memory such as the stif and sdram to the a-dmac. ? when the source is not the stif (c[i]sa bit = 0) c[i]so3: data swap in two-byte units (longword swap in word units) 0: as-is 1: swap c[i]so2: data swap in one-byte units (word swap in byte units) 0: as-is 1: swap c[i]so1: inversion of bit 1 at address when one or two bytes are accessed 0: as-is 1: inversion c[i]so0: inversion of bit 0 at address when one byte is accessed 0: as-is 1: inversion c[i]so1 and c[i]so0 function for endian adjustment. note that if an endian different from the endi an of this lsi is used, up to three different addresses are accessed from the address where the start and end addresses are specified when an area is allocated. ? when the source is the stif (c[i]sa bit = 1) c[i]so3: data swap in two-byte units (longword swap in word units) 0: as-is 1: swap c[i]so2: data swap in one-byte units (word swap in byte units) 0: as-is 1: swap c[i]so1: data swap in one-bit uni ts (byte swap in one-bit units) 0: as-is 1: swap c[i]so0: set this bit to 0 as reserved. this bit is referenced in aes encryption/decryption, des/3des encryption/decryptio n, sha hash generation, hmac keyed hash generation, target data read for checksum operation, and data copy from memory to the stif and from the stif to memory. however, this bit is not referenced in key copy and initial vector copy.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 511 of 1262 rej09b0437-0100 bit bit name initial value r/w description 19 c[i]da 0 r/w dest ination attribute specifies whether the data read source uses the channel [i] (the destination address is not used) of the stif or the destination address (memory such as sdram). 0: uses the destination address (memory such as sdram). 1: uses the channel [i] of the stif 18 c[i]sa 0 r/w source attribute specifies whether the data read source uses the channel [i] (the source address is not used) of the stif or the source address (memory such as sdram). 0: uses the source address (memory such as sdram). 1: uses the channel [i] of the stif 17, 16 c[i]csm[1:0] 00 r/w checksum mode 00: checksum (not initialized, not written back) not beginning of data not end of data 01: checksum (not initialized, written back) not beginning of data end of data 10: checksum (initialized, not written back) beginning of data not end of data 11: checksum (initialized, written back) beginning of data end of data 15 to 3 ? all 0 r/w reserved these bits are always read as 0. the write value should always be 0.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 512 of 1262 rej09b0437-0100 bit bit name initial value r/w description 2 c[i]f2 0 r/w descriptor execution flag 2 when splitting continuous data into several descriptors for execution, set this bit to 1 in the descriptor that processes the last data part (because the pointer in the a-dmac must be initialized to process the next descriptor). use this flag when splitting and executing descriptors because the encryption/decry ption part, authentication part, and checksum operation part in data such as ipsec/tls differ. 0: non-last descriptor that processes continuous data 1: last descriptor that processes continuous data 1 c[i]f1 0 r/w descriptor execution flag 1 when this bit is 1, the a-dmac regards this descriptor as the last descriptor in the descriptor ring area. when processing of this descriptor ends, the a-dmac returns to the beginning (descriptor start address) of the descriptor ring area. 0: non-last descriptor ring 1: last descriptor ring 0 c[i]f0 0 r/w descriptor execution flag 0 when this bit is 0, the a-dmac ends processing because this descriptor is invalid . when this bit is 1, this descriptor is valid. when this bit is 1 (valid descriptor), the a-dmac sets this bit to 0 and writes back to the original address after processing of this descriptor ends. 0: invalid descriptor 1: valid descriptor
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 513 of 1262 rej09b0437-0100 14.2.7 channel [i] processing descriptor 1 register (c[i]d1) [source address] (i = 0, 1) do not write any value to this regi ster when c[i]c_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w c[i]d1[31:16] c[i]d1[15:0] bit bit name initial value r/w description 31 to 0 c[i]d1[31:0] a ll 0 r/w source address specify a source address. this register is used when source access involves memory reference. it is not used in the stif. when copying a key or initial vector from the source, set 0000 in the lower four bits (16-byte boundary). when splitting continuous data into several descriptors for execution, specify the same source address in all the descriptors.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 514 of 1262 rej09b0437-0100 14.2.8 channel [i] processing descriptor 2 register (c[i]d2) [destination address] (i = 0, 1) do not write any value to this regi ster when c[i]c_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w c[i]d2[31:16] c[i]d2[15:0] bit bit name initial value r/w description 31 to 0 c[i]d2[31:0] all 0 r/w tr ansfer data destination address specify a destination address to which to write back the transfer data. when splitting continuous data into several descriptors for execution, specify the same source address in all the descriptors. 14.2.9 channel [i] processing descriptor 3 register (c[i]d3) [data length] (i = 0, 1) do not write any value to this regi ster when c[i]c_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ?? c[i]dwe c[i]die ???????????? c[i]d3[15:0] 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 515 of 1262 rej09b0437-0100 bit bit name initial value r/w description 31, 30 ? all 0 r/w reserved these bits are always read as 0. the write value should always be 0. 29 c[i]dwe 0 r/w "1 descriptor processing end" interrupt release wait enable if this bit is 1 and the "1 descriptor processing" interrupt is requested, the a-dmac waits for the interrupt release before it moves to next descriptor processing. 0: does not observe the "1 descriptor processing end" interrupt. 1: enables "1 descriptor processing end" interrupt release wait. 28 c[i]die 0 r/w "1 descriptor processing end" interrupt request enable specifies whether to enable or disable the "1 descriptor processing end" interrupt when processing of this descriptor ends. processing does not end even if the "1 descriptor processing end" interrupt request is enabled. 0: disables the "1 descriptor processing end" interrupt request. 1: enables the "1 descriptor processing end" interrupt request. 27 to 16 ? all 0 r/w reserved these bits are always read as 0. the write value should always be 0.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 516 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 to 0 c[i]d3[15:0] all 0 r/w target data size (byte length) the target data size range that can be specified in these bits is as follows: 0 < c[i]d3[15:0] <= 2^16-96 basically, set a multiple of the length of block to be processed. for checksum, set a multiple of 2 bytes. when using continuous data over several descriptors, set the total of sizes specified in each descriptor in multiples of the block length. also set the total size not to exceed 2^32. 14.2.10 channel [i] processing descriptor 4 register (c[i]d4) [checksum value write address] (i = 0, 1) do not write any value to this regi ster when c[i]c_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 0000000000000000 r c[i]d4[31:16] c[i]d4[15:1] - bit bit name initial value r/w description 31 to 1 c[i]d4[31:1] all 0 r/w 0 ? 0 r write address of the checksum calculation result. the lower four bits should be 0. set a two-byte boundary address. 14.2.11 fec dmac processing control register (fecc) a suspension direction is evaluated after descriptor processing in progress is completed (descriptor write-back). if fecc_e is 1 when th e suspension direction is evaluated, the fec
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 517 of 1262 rej09b0437-0100 dmac enters the wait cycle. if the fec dmac is restarted because 1 was written to fecc_e during the wait cycle, the fec dmac moves to next descriptor read unless the descriptor written back just before is the last descriptor. if the descriptor is the last descriptor, the fec dmac ends processing and enters the idle state. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r/w r r r r r r r r/w r r r r/w 0000000000000000 r r r r/w r r r r/w r r r r/w r r r r/w ??? fecc_ r ??? fecc_ dwf ??? fecc_ dwe ??? ??? fecc_ lie ??? ??? fecc_ eie ??? fecc_ e fecc_ nie fecc_ die bit bit name initial value r/w description 31 to 29 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 28 fecc_r 0 r/w reset writing 1 to this bit during stop causes the fec processing sequence to be reset. this bit is automatically and immediately set to 0. setting both this bit and the fecc_e bit to 1 causes fec processing to be newly star ted except when the following bits are set to 1: fecc_dwe, fecc_die, fecc_lie, fecc_nie, fecc_eie, fecc_e, fecdsa, and fecdca 27 to 25 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 24 fecc_dw f 0 r wait state flag after descriptor processing end 0: non-wait state 1: wait state there are two methods for under standing the processing state of the fec dmac descriptor. in one, when the fec dmac is executed, fec_dwe is set to 1 and then fecc_die is set to 1 to accept the "1 descriptor processing end" interrupt request. in the other, the processing state is obs erved till this bit is set to 1.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 518 of 1262 rej09b0437-0100 bit bit name initial value r/w description 23 to 21 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 20 fecc_dw e 0 r/w "1 descriptor processing end" interrupt request release wait enable when this bit is 1, the fec dmac ends processing of this descriptor and enters the wait state unless fecc_die is 0 after write-back. if the "1 descriptor processing end" interrupt is requested, the fec dmac waits for release of the interrupt before it moves to processing of the next descriptor. if this descriptor is the last descriptor when the interrupt is released, the fec dmac ends processing a nd enters the idle state. if this descriptor is not the last descriptor, the fec dmac reads the next descriptor. 0: the fec dmac does not enter the wait state when the "1 descriptor processing end" interrupt is requested. 1: the fec dmac enters th e wait state when the "1 descriptor processing end" interrupt is requested. 19 to 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 fecc_die 0 r/w "1 descriptor processing end" interrupt request enable specifies whether to enable or disable the "1 descriptor processing end" interrupt request when processing of this descriptor ends. processing does not end even if this interrupt is requested. this bit functions as the feci_di mask. 0: disables the "1 descriptor processing end" interrupt request. 1: enables the "1 descriptor processing end" interrupt request. 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 519 of 1262 rej09b0437-0100 bit bit name initial value r/w description 12 fecc_lie 0 r/w "last descriptor processing end" notification interrupt request enable specifies whether to enable or disable the "last descriptor processing end" interrupt request when processing of the last descriptor ends (feci_li mask). 0: disables the "last descriptor processing end" interrupt request. 1: enables the "last descriptor processing end" interrupt request. 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 fecc_nie 0 r/w "invalid descriptor" no tification interrupt request enable specifies whether to enable or disable the "invalid descriptor" notification interrupt request when the invalid descriptor is fetched (feci_ni mask). 0: disables the "invalid descriptor" notification interrupt request. 1: enables the "invalid descripto r" notification interrupt request. 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 fecc_eie 0 r/w "processing end" interrupt request enable specifies whether to enable or disable the "processing end" interrupt request when processing ends (feci_ei mask). 0: disables the "processing end" interrupt request. 1: enables the "processing end" interrupt request. 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 520 of 1262 rej09b0437-0100 bit bit name initial value r/w description 0 fecc_e 0 r/w execution request setting this bit to 1 causes fec processing to be started. setting this bit to 0 during fec processing causes fec processing to be suspended. after fec processing ends, this bit is automatically set to 0. there are two methods for understanding the fec dmac operating state. in one, when the fec dmac is executed, fecc_eie is set to 1 to accept the "operation end" interrupt request. in the other, the operating state is observed till the key of this bit is set to 0. 0: fec processing is halted. 1: fec processing is in progress. 14.2.12 fec dmac processing interrupt request register (feci) ad_irqfec_n is asserted as negation of logical or of all bits in this register. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r r/w r r r r/w r r r r/w r r r r/w ??????????????? ??? feci_ di ??? feci_ li ??? feci_ ni ??? ? feci_ ei
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 521 of 1262 rej09b0437-0100 bit bit name initial value r/w description 31 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 feci_di 0 r/w "1 descriptor proce ssing end" interr upt notification request this interrupt notifies you that the fec dmac ended 1 descriptor processing and wrote back the descriptor. this bit is cleared to 0 by writing 1 to it. when 0 is written to this bit, the current state is retained. this interrupt is masked by the fecc_die bit of the descriptor. 0: the "1 descriptor processing end" interrupt is not requested. 1: the "1 descriptor processing end" interrupt is requested. 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 feci_li 0 r/w "last descriptor (descriptor where fecd00_f2 is 1) processing end" interr upt notification request this interrupt notifies you that the fec dmac wrote back the last descriptor and ended last descriptor processing. the fec dmac enters the idle state after it ended last descriptor processing. this bit is cleared to 0 by writing 1 to it. when 0 is written to this bit, the current state is retained. if this bit is set, the fec dmac is in the initial state because descriptors ran dry. in this case, replenish new descriptors and then restart the fec dmac. this interrupt is masked by the fecc_lie bit of the fecc. 0: the "last descriptor processing end" interrupt is not requested. 1: the "last descriptor processing end" interrupt is requested.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 522 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 feci_ni 0 r/w "invalid descripto r (descriptor where fecd00_f0 is 0) interrupt interrupt request for read end notification. when this interrupt request is made, the fec dmac ends processing and enters the idle state. this bit is cleared to 0 by writing 1 to it. when 0 is written to this bit, the curr ent state is retained. this interrupt is masked by the fecc_nie bit of the fecc. if this bit is set, the fec dmac is in the initial state because descriptors ran dry. in this case, replenish new descriptors and then restart the fec dmac. 0: the "invalid descriptor processing end" interrupt is not requested. 1: the "invalid descriptor processing end" interrupt is requested. 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 feci_ei 0 r/w "processing end" interrupt request this interrupt notifies you that processing ended due to the feci_li or feci_ni interrupt source and the fec dmac is now in the idle state. this bit is cleared to 0 by writing 1 to it. when 0 is written to this bit, the curr ent state is retained. this interrupt is masked by the fecc_eie bit of the fecc. if this bit is set, the fec dmac is in the initial state because descriptors ran dry. in this case, replenish new descriptors and then restart the fec dmac. 0: the "processing end" in terrupt is not requested. 1: the "processing end" interrupt is requested.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 523 of 1262 rej09b0437-0100 14.2.13 fec dmac processing descriptor start address register (fecdsa) do not write any value to this register when fecc_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r r r r fecdsa[3:0] fecdsa[31:16] fecdsa[15:4] bit bit name initial value r/w description 31 to 4 fecdsa[31:4] all 0 r/w 3 to 0 fecdsa[3:0] all 0 r descriptor ring start address specify a descriptor ring start address. set a 16-byte boundary address value.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 524 of 1262 rej09b0437-0100 14.2.14 fec dmac processing descript or current address register (fecdca) do not write any value to this register when fecc_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r r r r fecdca[3:0] fecdca[31:16] fecdca[15:4] bit bit name initial value r/w description 31 to 4 fecdsa[31:4] all 0 r/w 3 to 0 fecdsa[3:0] all 0 r descriptor current address specify the start address of descriptor processing. set a 16-byte boundary address value. when descriptor processing is in progress, these bits indicate the address of descriptor currently being processed. after descriptor write-back, these bits indicate the address of the next descriptor. when the fec dmac enters the idle state after it has processed the descriptor where the last flag is set, this register indicates the address of the next descriptor of the descriptor where the last flag is set.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 525 of 1262 rej09b0437-0100 14.2.15 fec dmac processing descriptor 0 register (fecd00) [control] do not write any value to this register when fecc_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: inital value: r/w: bit: inital value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w fecd00_so[3:0] fecd00_sn[3:0] fecd00_ dre fecd00_ f2 fecd00_ f1 fecd00_ f0 fecd00_do[3:0] fecd00_sz[15:0] bit bit name initial value r/w description 31 to 16 fecd00_sz[15:0] all 0 r/w data size (byte length) specify the byte size of data to be processed. set a value from 0 to 65504. do not set a value from 65505 to 65536. the ethernet payload lengt h is 1500 bytes. the fec payload length further becomes less than the ethernet payload length because the fec packet payload does not exist in the rtp of the udp in ip. if the mpeg-2ts packet size is considered, it is highly likely that 1344 bytes will be used as the ip- tv payload length. consider 1344 bytes as typ.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 526 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 to 12 fecd00_do[3:0] all 0 r/w these bits function when the destination is read or written. fecd00_do3: data swap in two-byte units (longword swap in word units) 0: as-is 1: swap fecd00_do2: data swap in one-byte un its (word swap in byte units) 0: as-is 1: swap fecd00_do1: inversion of bit 1 at address when one or two bytes are accessed 0: as-is 1: inversion fecd00_do0: inversion of bit 0 at address when one byte is accessed 0: as-is 1: inversion fecd00_do1 and fecd00_do0 function for endian adjustment. note that if an endian different from the endian of this lsi is used, up to three different addresses are accessed from the address where the start and end addresses are specified when an area is allocated.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 527 of 1262 rej09b0437-0100 bit bit name initial value r/w description 11 to 8 fecd00_so[3:0] all 0 r/w these bi ts function when the source is read. fecd00_so3: data swap in two-byte units (longword swap in word units) 0: as-is 1: swap fecd00_so2: data swap in one-byte un its (word swap in byte units) 0: as-is 1: swap fecd00_so1: inver,sion of bit 1 at address when one or two bytes are accessed 0: as-is 1: inversion fecd00_so0: inversion of bit 0 at address when one byte is accessed 0: as-is 1: inversion fecd00_so1 and fecd00_so0 function for endian adjustment. note that if an endian different from the endian of this lsi is used, up to three different addresses are accessed from the address where the start and end addresses are specified when an area is allocated. 7 to 4 fecd00_sn[3:0] all 0 r/w number of source addresses specify the number of source addresses subject to fec operation. 0000: the number of source addresses is 1. 0001: the number of source addresses is 2. others: reserved (setting prohibited)
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 528 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 fecd00_dre 0 r/w destination read enable 0: does not read the destination. 1: reads the destinati on and updates the read values. 2 fecd00_f2 0 r/w descriptor execution flag 2 when 1, this bit explicitly indicates that this descriptor is the last descr iptor that should operate. (another method for explicitly indicating that this descriptor is the last descriptor is to place an invalid descriptor immediately after this descriptor.) 0: this descriptor is not the last descriptor that should operate. 1: this descriptor is the last descriptor that should operate. 1 fecd00_f1 0 r/w descriptor execution flag 1 when this bit is 1, the fec dmac regards this descriptor as the last descriptor in the descriptor ring area and returns to the beginning (descriptor start address) of the descriptor ring area when processing of this descriptor ends. 0: this descriptor is not regarded as the last descriptor in the descriptor ring area. 1: this descriptor is regarded as the last descriptor in the descriptor ring area. 0 fecd00_f0 0 r/w descriptor execution flag 0 when this bit is 0, processing of this descriptor ends because this descriptor is invalid. if the descriptor where fecd00_f0 is 0 is processed, the fec dmac suspends fec processing on the assumption that fecc_e is 0. when this bit is 1, this descriptor is valid. if this descriptor is valid, the fec dmac sets this bit to 0 and writes back to the original address when processing of this descriptor ends. 0: this descriptor is invalid. 1: this descriptor is valid.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 529 of 1262 rej09b0437-0100 14.2.16 fec dmac processing descriptor 1 register (fecd01d0a) [destination address] do not write any value to this register when fecc_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w fecd01d0a[31:16] fecd01d0a[15:0] bit bit name initial value r/w description 31 to 0 fecd01d0a[31:0] all 0 r/w destination address specify a processing data write-back destination address. 14.2.17 fec dmac processing descriptor 2 register (fecd02s0a) [source 0 address] do not write any value to this register when fecc_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w fecd02s0a[31:16] fecd02s0a[15:0] bit bit name initial value r/w description 31 to 0 fecd02s0a[31:0] all 0 r/w specif y the start address of source 0 data.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 530 of 1262 rej09b0437-0100 14.2.18 fec dmac processing descriptor 3 register (fecd03s1a) [source 1 address] do not write any value to this register when fecc_e is set to 1. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w fecd03s1a[31:16] fecd03s1a[15:0] bit bit name initial value r/w description 31 to 0 fecd03s1a[31:0] all 0 r/w specif y the start address of source 1 data.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 531 of 1262 rej09b0437-0100 14.3 functions table 14.5 lists a-dmac security/network functions. table14.5 a-dmac security/network functions classification item description conforming/ supported standard error detection checksum ? 1's complement sum operation rfc1071 support error correction fec ? fec xor operation ? support of any number of fec matrixes rfc2733 pro-mpeg support
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 532 of 1262 rej09b0437-0100 14.3.1 dmac channel function the a-dmac has two dmac channels for checksum processing processing. table14.6 aes operation cycles key length encryption cycle decryption cycle 128 bits 10 20 192 bits 12 22 256 bits 14 24 table14.7 encryptio n operating modes mode name description ecb (electronic codebook mode) mode in which to input one block of pl ain text (ciphertext) and generate the corresponding ciphertext (plain text). in ecb, parallel processing is possible because processing per block is independent. in this mode, however, security is not high because the same ciphertext is output for a combinatio n of the same plain text data and encryption keys. cbc (cipher block chaining mode) mode in which to generate ciphertext by xoring plain text with the immediately preceding encrypted block to encrypt the block. in the first block, the initial vector (iv) is xored with plain text. you do not need to keep the iv confidential but need to change it when using the same encryption key. decryption is performed in reverse order of encryption. this mode does not support parallel processing. cfb (cipher feedback mode) mode in which to encrypt the cipher text generated in the immediately preceding block and xor the block with plain text to obtain new ciphertext. the first block processing encrypts t he iv and xors it with plain text to obtain ciphertext. decryption processing encrypts ciphertext and xors it with the ciphertext of the next block to obtain plain text. like this, cfb decryption processing is achieved via enc ryption operation. however, this mode does not support parallel processing. ofb (output feedback mode) mode in which to encrypt the immediately preceding encryption block and xor the obtained block with plain text (ciphertext) to generate ciphertext (plain text). the first block processing uses t he iv. ofb decryption processing is achieved via encryption operation. however, this mode does not support parallel processing.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 533 of 1262 rej09b0437-0100 mode name description ctr (counter mode) mode in which to encrypt "counter" consisting of random numbers and counters and xor the obtained block with plain text (ciphertext) to generate ciphertext (plain text). the counter is incremented per proc essing block. this mode supports parallel processing. if the aes encryption/decryption function is used by the dmac channel, the a-dmac uses the descriptors to update keys and initial vectors. the a-dmac can also use the descriptors to output the intermediate values (intermediate result) of the initial vectors obtained when encryption/decryption was performed in encryption operating mode other than ecb. 14.3.2 checksum checksum is a data error detection scheme. checksum splits the entered data in 16-bit units and calculates their 1's complement sum to detect an error. for example, tcp checksum used to detect packet errors on the receiving si de splits information called an ip pseudo header, tcp header, and tcp payload data in 16-bit units and calculates their 1's complement sum. if the obtained 1's complement sum is h'ffff or h'0000, it indicates that no packet error occurred. if the 1's complement sum is not h'ffff and h'0000, it indicates that a packet error occurred. the a-dmac has a function to calculate the 1's complement sum of data obtained via dma transfer. 14.3.3 fec channel the a-dmac has one channel for fec operation. this channel can perform xor operation for the data obtained via dma transfer and write ba ck to memory because it is of a descriptor structure that can cope with fec operation of any number of rows.
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 534 of 1262 rej09b0437-0100 14.3.4 fec operation fec is an error correction method. this method enab les the receiving side to repair the lost packet without requesting packet retran smission. when repairing the lost packet by using fec, the transmitting side uses the original packet group to generate a redundant packet (fec packet). when transmitting 100 packets, for example, the transmitting side generates a 10 x 10 packet matrix, xors the ten original packets aligned to one row or column, and generates one fec packet per row (column). in this example, 20 fec packets are generated. the transmitting side transmits the original data pack et group and fec packets to the receiving side. to check whether the original packets are lo st, the receiving side aligns the orig inal packets and fec packets to the matrix as in the transmitting side. if a lost origin al packet is found, the tr ansmitting side can repair the packet by xoring the other packets in the row and column to which the lost packet belongs with the fec packets. like this, the transmitting side and receiving side need to share the number of rows and columns of matrix aligned to genera te fec packets before transmitting and receiving the packets. the a-dmac has the xor calculation function used for fec operation and supports the following fec specifications of rfc2733 and pro-mpeg: ? xor calculation of any number of rows (columns) a variable-length descriptor supports the fec structure of theoretically infinite length. ? one-dimensional fec not only two-dimensional fec bu t also one-dimensional fec is supported because processing is performed per row (column). the cpu must perform the following operations: ? fec matrix alignment ? lost packet detection ? unification of the lengths of packets that constitute a row (column) (packets less than the maximum pa cket length are padded with 0.) ? repair of a portion of timestamp and payload type from the result obtained from the a-dmac
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 535 of 1262 rej09b0437-0100 14.4 channel operation 14.4.1 descriptor format the a-dmac can automatically perform dma tran sfer between memory and the stif without the cpu based on the descriptor containing inform ation such as a buffer pointer and its data size. the a-dmac automatically performs operations su ch as reading data from memory and writing the decrypted data to the stif according to the information stored in this descriptor. figure 14.2 shows the descriptor format. the gray parts in the figure are ignored when descriptor processing is started and "0" is written back to these parts after descript or processing ends. for details on each bit, see section 14.2.6, channel [i] processing descriptor 0 register (c[i]d0) [control] (i = 0, 1), to section 14.2.10, channel [i] processing descriptor 4 register (c[i]d4) [checksum value write address] (i = 0, 1). 31 0 crdo[3:0] address bit chdo[3:0] so[3:0] da sa d1 [31:0] d4 [31:1] d2 [31:0] csm[1:0] f[2:0] +4 +8 +12 +16 +20 +24 +28 30 29 28 dwe die d3 [15:0] 27-26 25-24 23-20 17-16 15-3 2-1 0 19 18 figure 14.2 descriptor format a descriptor is 16/32-byte variable length or 32-byte fixed length. select variable length or fixed length from the variable-length descriptor control flag (c[i]c_vld) of the channel [i] processing control register (c[i]c). if c[i]c_vld is set to 1 to operate the descriptor as the variable-length descriptor, the remaining 16 bytes are read when the following conditions are met: ? checksum calculation result write-back is set (c[i]csm0 = 1).
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 536 of 1262 rej09b0437-0100 14.4.2 basic channel operation when "1" is written to the c[i]c_e bit of the ch annel [i] processing cont rol register (c[i]c), channel [i] reads the descriptor from the c[i]dca31 to c[i]dca4 addresses. if a fixed length is set in c[i]c_vld, the first 32 bytes are continuously read. if variable length is set, the remaining 16 bytes are read according to the previously explained conditions. if the c[i]f0 flag of the first longword of a descriptor is 1, the descriptor is fetched to the appropriate register of channel [i] processing descriptor 0 (c[i]d0) to channel [i] processing descriptor 4 (c[i]d4). after 1-descriptor processing ends, channel [i] sets the c[i]f0 flag to 0 and writes back to the original area. any number of descriptors can be allocated onto memory in the ring form. processing is started from the descriptor allocated to the address indi cated by the channel [i] processing descriptor current address register (c[i]dca). if descriptors where the c[i]f0 flag of channel [i] processing descriptor 0 (c[i]d0) is set to 1 continue, channel [i] processes them one after another. if the c[i]f1 flag of channel [i] processing descriptor 0 (c[i]d0) is 1, channel [i] assumes that the end of descriptor ring was detected and processes the desc riptor allocated to the address indicated by the channel [i] processing descriptor start address register (c[i]dsa). to end descriptor processing, allocate the invalid descriptor wh ere the c[i]f0 flag of channel [i] processing descriptor 0 (c[i]d0) is set to 0. if processing for single continuous data is divided into severa l descriptors, the data size of each processing must be saved between several descriptor processing. conversely, to handle different data, the data size of each processing must be in itialized. for this reason, whether the descriptor currently being executed handles the end of continuous data must be indicated in the descriptor. set this in the c[i]f2 flag. the a-dmac does not allow you to set data size 0 in c[i]d315 to c[i]d30.
section 14 dmac that works with encryption/decryption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 537 of 1262 rej09b0437-0100 14.4.3 checksum figure 14.3 shows an example of descriptors that execute only checksum. in figure 14.3, (a) is an example of continuously allocati ng checksum descriptors each of which completes one processing and (b) is an example of splitting processing into several checksum descriptors and allocating the last checksum descriptor th at completes processing. in the descriptor that performs checksum operation, set the data size in multiples of two bytes. however, if split descriptors are used, a value other than a multiple of two bytes can be set as the data size in each descriptor but the total number of data sizes specified in the split descriptors must be set so that it becomes a multiple of 2. (if processing is split into several descriptors and an odd size is specified in the non-last descriptor, th e a-dmac waits for the next descriptor without processing data of the last one byte.)
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 538 of 1262 rej09b0437-0100 checksum descriptor c[i]csm[1:0] = h'3 c[i]cm[6:0] = h'7f c[i]hm[4:0] = h'1f c[i]f2 = 1 c[i]f0 = 1 checksum descriptor c[i]csm[1:0] = h'3 c[i]cm[6:0] = h'7f c[i]hm[4:0] = h'1f c[i]f2 = 1 c[i]f0 = 1 invalid descriptor c[i]csm[1:0] = any c[i]cm[6:0] = any c[i]hm[4:0] = any c[i]f2 = any c[i]f0 = 0 checksum descriptor c[i]csm[1:0] = h'2 c[i]cm[6:0] = h'7f c[i]hm[4:0] = h'1f c[i]f2 = 0 c[i]f0 = 1 (a) example of continuously allocating checksum descriptors each of which completes one processing (b) example of splitting processing into several checksum descriptors and allocating the last checksum descriptor that completes processing checksum descriptor c[i]csm[1:0] = h'0 c[i]cm[6:0] = h'7f c[i]hm[4:0] = h'1f c[i]f2 = 0 c[i]f0 = 1 checksum descriptor c[i]csm[1:0] = h'1 c[i]cm[6:0] = h'7f c[i]hm[4:0] = h'1f c[i]f2 = 1 c[i]f0 = 1 invalid descriptor c[i]csm[1:0] = any c[i]cm[6:0] = any c[i]hm[4:0] = any c[i]f2 = any c[i]f0 = 0 figure 14.3 examples of al locating checksum descriptors
section 14 dmac that works with encryption/decryption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 539 of 1262 rej09b0437-0100 14.5 fec channel operation 14.5.1 descriptor fo rmat for fec channel figure 14.4 shows the descriptor format for the fec channel. the fec channel can automatically perform dma transfer with memo ry without the cpu according to descriptor information. two source addresses can be specified in a descriptor but linking descriptors in the ring form provides fec processing of any number of rows (columns). only i-bus can access fec channel data due to it s application, so info rmation indicating the source and destination directions (i-bus or stif) is not included in the descriptor. the size of data subject to fec operation must match the data size set in the fecd0_sz15 to fecd0_sz0 flag of fec dmac processing descriptor 0 (fecd00) in the first longword of the fec descriptor. for this reason, when processing data less than the data size set in the fecd0_sz15 to fecd0_sz0 flag, you must pad the data with 0 and perform fec processing. 31-16 0 sz[15:0] address bit do[3:0] sn[3:0] so[3:0] dre f[2:0] d01d0a [31:0] d02s0a [31:0] d03s1a [31:0] or padding +4 +8 +12 15-12 11-8 7-4 3 2-0 figure 14.4 fec dmac descriptor format
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 540 of 1262 rej09b0437-0100 14.5.2 basic fec channel operation when "1" is written to the fecc_e bit of the fec dmac processing control register (fecc), the fec channel starts descriptor read. if the fecd00_f0 flag in the first longword is "1", descriptors are fetched in turn to the appropriate register , starting from fecd00 in the first longword. after descriptor read is completed, the fec chan nel reads data from memo ry space indicated by a source address and performs fec operation (xor calculation). after xor calculation with all source addresses is completed, the fec channel writes back the result to destination address space. after 1-descriptor processi ng ends, the fec channel sets the fecd00_f0 flag to "0" and writes back to the original area. to support the fec matrix operation of any nu mber of rows and columns, the fec channel installed on the a-dmac temporarily writes back the fec operation result of source rows/columns that can be processed by one descriptor to the destination address. if the fec matrix consists of two rows, the fec matrix operation ends in one descriptor. if the fec matrix consists of 3 rows/columns or more, the fec channel splits the matrix into several descriptors and performs fec matrix processing. if this processing must be split into several descriptors, use the fecd00_dre bit to control the fec operation. figure 14.5 shows an example of descriptor configuration where the fec matrix operation is split into several descriptors for execution. in the first descriptor that starts the fec operation, fecd00_dre is set to 0 because the operation result is not yet written. in the second and subsequent descriptors, the fec operation is continued. in other words, to xor the calculation result of the previous descriptor with the current descriptor source, fecd00_dre is set to 1. piling up such descriptors till the number of rows or columns for the fec matrix operation is met makes it possible to obtain the last xor oper ation result of the target row (column). any number of descriptors can be allocated onto memory in the ring form. processing is started from the descriptor allocated to the address i ndicated by the fec dmac processing descriptor current address register (fecdca). if descri ptors where the fecd00_f0 flag of fec dmac processing descriptor 0 (fecd00) is set to 1 continue, the fec channel processes them one after another. if the fecd00_f1 flag of fecd00 is 1, the fec channel assumes that the end of descriptor ring was detected and processes the desc riptor allocated to the address indicated by the fec dmac processing descriptor start address register (fecdsa). to end descriptor processing, allocate the invalid descriptor wh ere the fecd00_f0 flag of fecd00 is set to "0" or allocate the last descriptor where the fecd00_f2 flag of fecd00 is set to "1".
section 14 dmac that works with encryption/decryption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 541 of 1262 rej09b0437-0100 fec operation last descriptor (1 source rows/column processing) fecd00_sz[15:0] = xor operation data size fecd00_sn[3:0] = h'1 fecd00_dre = 1 fecd00_f2 = 1 fecd00_f0 = 1 invalid descriptor fecd00_f0 = 0 fec operation middle descriptor (2 source rows/column processing) fecd00_sz[15:0] = xor operation data size fecd00_sn[3:0] = h'2 fecd00_dre = 1 fecd00_f2 = 0 fecd00_f0 = 1 fec operation start descriptor (2 source rows/column processing) fecd00_sz[15:0] = xor operation data size fecd00_sn[3:0] = h'2 fecd00_dre = 0 fecd00_f2 = 0 fecd00_f0 = 1 figure 14.5 example of fe c descriptor configuration
section 14 dmac that works with encryption/decr yption and forward error correction core (a-dmac) rev. 1.00 nov. 14, 2007 page 542 of 1262 rej09b0437-0100
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 543 of 1262 rej09b0437-0100 section 15 stream interface (stif) this lsi has a 2-channel stream interface (stif). 15.1 features ? two-channel bidirectional interface ? supports ts packets (p acket size: 188 bytes). ? supports tts packets (p acket size: 192 bytes). ? supports ps packets (packet size: specified by the size register). ? 8-bit parallel transfer or 1-bit serial transfer is selectable. ? transfer direction is se ttable for each channel. ? polarity of each clock signal, request signal, synchronizing signal, and data enable signal is selectable. ? a pcr clock recovery module (pcrrcv) incorporated
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 544 of 1262 rej09b0437-0100 figure 15.1 shows a block diagram of the stif. tbd figure 15.1 block diagram of stif
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 545 of 1262 rej09b0437-0100 15.2 input/output pins table 15.1 shows the pin configuration of the stif. table 15.1 pin configuration name i/o function st_clkout output data clock output (common to channels) st0_clkin input data clock input st0_req i/o request signal st0_syc i/o synchronizing signal st0_vld i/o data enable st0_d[7:0] i/o data (st0_d[0] is used in serial mode) st0_vco_clkin input the m peg base clock is input from the external 27-mhz voltage controlled oscillator (vco). st0_pwm output the 27-mhz vco is c ontrolled through the low-pass filter (lpf). st1_clkin input data clock input st1_req i/o request signal st1_syc i/o synchronizing signal st1_vld i/o data enable st1_d[7:0] i/o data (st1_d[0] is used in serial mode) st1_vco_clkin input the m peg base clock is input from the external 27-mhz vco. st1_pwm output the 27-mhz vco is controlled through the lpf.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 546 of 1262 rej09b0437-0100 15.3 register descriptions the stif has the following registers. for the addr ess and status at each pr ocessing state of these registers, see section 28, list of registers. ? stif mode select register (stmdr_0) ? stif control register (stctlr_0) ? stif internal counter control register (stcntcr_0) ? stif internal counter set register (stcntvr_0) ? stif status register (ststr_0) ? stif interrupt enable register (stier_0) ? stif transfer size register (stsizer_0) ? stifpwm mode register (stpwmmr_0) ? stifpwm control register_0 (stpwmcr_0) ? stifpwm register (stpwmr_0) ? stifpcr0 register (stpcr0r_0) ? stifpcr1 register (stpcr1r_0) ? stifstc0 register (ststc0r_0) ? stifstc1 register (ststc1r_0) ? stif lock control register (stlkcr_0) ? stif debugging status register (stdbgr_0) ? stif mode select register (stmdr_1) ? stif control register (stctlr_1) ? stif internal counter control register (stcntcr_1 ? stif internal counter set register (stcntvr_1) ? stif status register (ststr_1) ? stif interrupt enable register (stier_1) ? stif transfer size register (stsizer_1) ? stifpwm mode register (stpwmmr_1) ? stifpwm control register_1 (stpwmcr_1) ? stifpwm register (stpwmr_1) ? stifpcr0 register (stpcr0r_1) ? stifpcr1 register (stpcr1r_1) ? stifstc0 register (ststc0r_1) ? stifstc1 register (ststc1r_1)
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 547 of 1262 rej09b0437-0100 ? stif lock control register (stlkcr_1) ? stif debugging status register (stdbgr_1) 15.3.1 stif mode sel ect register (stmdr) stmdr is a 32-bit register that selects operatin g mode, clock source, etc. of the on-chip stif module. stmdr is initialized to h'00000000 by a power-on reset. bit bit name initial value r/w description 31 to 15 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 14 lsbsel 0 r/w selects msb first or lsb first in serial mode. 0: msb-first data input/output 1: lsb-first data input/output 13 edgsel 0 r/w selects input/out put timing of stn_req, stn_syc, stn_vld, and stn_d[7:0]. 0: output and sampled at the rising edge of the synchronizing clock 1: output and sampled at the falling edge of the synchronizing clock the synchronizing clock is defined by the clksel and ckfrsel[3:0] bits in this register. 12 clksel 0 r/w selects synchronizing clock for stream transmit mode 0: stn_syc, stn_vld, and stn_d[7:0] are output in synchronization with st_clkout. stn_req is sampled in synchronization with st_clkout 1: stn_syc, stn_vld, and stn_d[7:0] are output in synchronization with stn_clkin. stn_req is sampled in synchronization with stn_clkin.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 548 of 1262 rej09b0437-0100 bit bit name initial value r/w description 11 10 9 8 ckfrsel3 ckfrsel2 ckfrsel1 ckfrsel0 0 0 0 0 r/w r/w r/w r/w these bits select the clock source of st_clkout (available for stmdr_0 only). 0000: b 0001: i /2 0010: i /3 0011: i /4 0100: i /6 0101: i /8 0110: i /12 0111: reserved (setting prohibited) 1000: reserved (setting prohibited) 1001: reserved (setting prohibited) 1010: reserved (setting prohibited) 1011: reserved (setting prohibited) 1100: reserved (setting prohibited) 1101: reserved (setting prohibited) 1110: reserved (setting prohibited) 1111: output is fixed to low. notes: 1. for serial mode, select a clock source of b or less. for parallel mode, se lect a clock source of b /2 or less. for example, when i : b = 3 : 1 or 6 : 2 is set in the cpg, i /2 is not selectable for serial mode. for parallel mode, i /2 and i /4 are not selectable. 2. select a clock source t hat satisfies the following: stn_clkin b 80% (serial mode) stn_clkin (b /2) 80% (parallel mode) 7 reqactsel 0 r/w selects the active polarity of stn_req. 0: active-high 1: active-low
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 549 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 vldactsel 0 r/w selects the active polarity of stn_vld. 0: active-high 1: active-low 5 sycactsel 0 r/w selects the active polarity of stn_syc. 0: active-high 1: active-low 4 iosel 0 r/w selects stream input or output direction. 0: input (from an external device to this lsi) 1: output (from this lsi to an external device) 3 2 1 0 ifmdsel3 ifmdsel2 ifmdsel1 ifmdsel0 0 0 0 0 r/w r/w r/w r/w these bits select operating mode. 0000: ts serial mode 1 0001: ts parallel mode 1 0010: ts serial mode 2 0011: ts parallel mode 2 0100: ts serial mode 3 0101: ts parallel mode 3 0110: reserved (setting prohibited) 0111: reserved (setting prohibited) 1000: tts serial mode 1001: tts parallel mode 1010: reserved (setting prohibited) 1011: reserved (setting prohibited) 1100: ps serial mode 1101: ps parallel mode 1110: reserved (setting prohibited) 1111: reserved (setting prohibited) [legend] n = 0, 1
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 550 of 1262 rej09b0437-0100 15.3.2 stif control register (stctlr) stctlr is a 32-bit register that sets the recovery processing switching threshold value and enables/disables dma transfer requests. stctlr is initialized to h'00000000 by a power-on reset. bit bit name initial value r/w description 31 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 10 9 rcvtm2 rcvtm1 rcvtm0 0 0 0 r/w r/w r/w these bits set the recovery processing switching threshold value for packet output in ts mode 1 or ts mode 2. these bits are valid when rcv = 1. 000: approximately 0.625 seconds 001: approximately 1.25 seconds 010: approximately 2.5 seconds 011: approximately 5 seconds 100: approximately 10 seconds 101: approximately 20 seconds 110: approximately 40 seconds 111: approximately 80 seconds the recovery functions are processed as follows: recovery function (1) when the internal counter value exceeds the timestamp value and the difference is smaller than the set threshold value, the packet is output immediately. recovery function (2) when the internal counter value exceeds the timestamp value and the difference is larger than the set threshold value, the packet is discarded and the recovery processing restarts with the next packet. (the next packet is output immediately, and the packet's ti mestamp is reloaded to the internal counter for timestamp at the same time.) recovery function (3) when the internal counter value is under the timestamp value but the difference is larger than the set threshold value, the packet is discarded and the recovery processing restarts with the next packet. (the next packet is output immediately, and the packet's ti mestamp is reloaded to the internal counter for timestamp at the same time.)
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 551 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 rcv 0 r/w enables the recovery functions when outputting packets in ts mode 1 or ts mode 2. 0: recovery functions disabled 1: recovery functions enabled 7 trick 0 r/w enables the function that transfers stream independently of timestamp when outputting packets in ts mode 1 or ts mode 2. 0: transfer function disabled 1: transfer function enabled 6 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 reqen 0 r/w enables or disables dma transfer requests to the a-dmac. 0: disabled 1: enabled 1 en 0 r/w enables or disables stream input/output. 0: disabled 1: enabled 0 srst 0 r/w setting this bit to 1 causes the internal state of this lsi to be initialized with register settings retained. when a ts packet is received for the first time after the initialization, the timestamp value of the ts packet is reloaded to the internal counter for timestamp. while 1 is read from this bit, the initialization is in progress. this bit is automatically cleared to 0. whenever the stmdr setting is modified, be sure to set srst to 1 to initialize this lsi and then set en and reqen to 1 to enable stream transfer.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 552 of 1262 rej09b0437-0100 15.3.3 stif internal count er control register (stcntcr) stcntcr is a 32-bit register to control the internal counter for timestamp. stcntcr is initialized to h'00000000 by a power-on reset. bit bit name initial value r/w description 31 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 crd 0 r/w setting this bit to 1 causes the internal counter value for timestamp to be read to stcntvr. this bit is automatically cleared to 0. 2 cstp 0 r/w stops the internal counter for timestamp. 0: count operation is continued. 1: counter is stopped with its value retained. 1 cset 0 r/w setting this bit to 1 causes the stcntvr value to be reloaded to the internal counter for timestamp. this bit is automatically cleared to 0. 0 crst 0 r/w setting this bit to 1 causes the internal counter for timestamp to be initialized to h'00000000. this bit is automatically cleared to 0.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 553 of 1262 rej09b0437-0100 15.3.4 stif internal coun ter set register (stcntvr) stcntvr is a 32-bit register that reads or reloads the value of the internal counter for timestamp in combination with the settings of the crd and cset bits in stcntcr. stcntvr is initialized to h'00000000 by a power-on reset. bit bit name initial value r/w description 31 to 0 vlu31 to vlu0 all 0 r/w internal counter value for timestamp 15.3.5 stif status register (ststr) ststr is a 32-bit register that indicates the status of the recovery functions, packet transmission/reception, and pcr clock recovery. ststr is initialized to h'00000000 by a power- on reset. bit bit name initial value r/w description 31 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 lkzf 0 r/w indicates whether the pll error amount (internal stc - internal pcr) falls within threshold value range lkcyc when a pcr packet is received. 0: within threshold value range (pll error amount (internal stc - internal pcr) =< lkcyc) 1: outside threshold value range (pll error amount (internal stc - internal pcr) > lkcyc) this bit is cleared to 0 by writing 1.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 554 of 1262 rej09b0437-0100 bit bit name initial value r/w description 11 lkf 0 r/w indicates pll lock status. 0: pll unlocked in the case of ulcnt >= ulref due to continued lkzf = 1 state (outside threshold value range) when a pcr packet is received with pll locked (lkf = 1) 1: pll locked in the case of lkcnt >= lkref due to continued lkzf = 0 state (within threshold value range) when a pcr packet is received with pll unlocked (lkf = 0) this bit is cleared to 0 by writing 1. 10 disf 0 r/w status flag bit that in dicates the discontinuity_indicator (table 15.5) of received pcr_pid. this bit is set to 1 upon completion of transfer (internal pcr stc internal stc) this bit is cleared to 0 by writing 1. 9 unzf 0 r/w this bit is set to 1 when data transfer from internal pcr to stc counter and data transfer fr om stc counter to internal stc are completed and the com parison of the upper data of received pcr_pid does not match (internal stc - internal pcr exceeded the acceptable comparison result range specified by pwmcyc; see figure 15.9). this bit is also set to 1 when pcr_pid (table 15.5) is received after "discont." furthermore, if the pwm control variable with a bit width of the effective comparison bit count "n" specified by pwmcyc is -(2^n), this bit is set to 1 as invalid pwm control variable (ilgl = 1 hereinafter) in the same manner as above. this bit is cleared to 0 by writing 1. 8 pcrf 0 r/w this bit is set to 1 wh en data transfer from internal pcr to stc counter and data transfer fr om stc counter to internal stc are completed. these transfers take place when a packet whose pcr_pid was detected satisfies the co nditions in table 15.4. this bit is cleared to 0 by writing 1.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 555 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 tendf 0 r/w indicates completion of output packet transfer for the transfer data size specified by stsizer in ps mode. this bit is cleared to 0 by writing 1. 6 rendf 0 r/w indicates completion of input packet transfer for the transfer data size specified by stsizer in ps mode. this bit is cleared to 0 by writing 1. 5 rcvf3 0 r/w this bit is set to 1 wh en recovery function (3) is activated when outputting a packet in ts mode 1 or ts mode 2. this bit is cleared to 0 by writing 1. 4 rcvf2 0 r/w this bit is set to 1 wh en recovery function (2) is activated when outputting a packet in ts mode 1 or ts mode 2. this bit is cleared to 0 by writing 1. 3 rcvf1 0 r/w this bit is set to 1 wh en recovery function (1) is activated when outputting a packet in ts mode 1 or ts mode 2. this bit is cleared to 0 by writing 1. 2 upf 0 r/w this bit is set to 1 when a packet shorter than 188 bytes is received in ts mode 1 or ts mode 2. such packets are discarded. this bit is cleared to 0 by writing 1. 1 opf 0 r/w this bit is set to 1 when a packet longer than 188 bytes is received in ts mode 1 or ts mode 2. such packets are discarded. this bit is cleared to 0 by writing 1. 0 o vf 0 r/w this bit is set to 1 when data read by the a-dmac is delayed and therefore the receive data which came later is discarded in ts mode 1 or ts mode 2. this bit is cleared to 0 by writing 1.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 556 of 1262 rej09b0437-0100 15.3.6 stif interrupt enable register (stier) stier is a 32-bit register to control various inte rrupt requests. stier is initialized to h'00000000 by a power-on reset. bit bit name initial value r/w description 31 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 lkze 0 r/w enables or disables lkzf interrupt requests. 0: lkzf interrupt requests are disabled. 1: lkzf interrupt requests are enabled. 11 lke 0 r/w enables or disables lkf interrupt requests. 0: lkf interrupt requests are disabled. 1: lkf interrupt requests are enabled. 10 dise 0 r/w enables or disables disf interrupt requests. 0: disf interrupt requests are disabled. 1: disf interrupt requests are enabled. 9 unze 0 r/w enables or disables unzf interrupt requests. 0: unzf interrupt requests are disabled. 1: unzf interrupt requests are enabled. 8 pcre 0 r/w enables or disables pcrf interrupt requests. 0: pcrf interrupt requests are disabled. 1: pcrf interrupt requests are enabled. 7 tende 0 r/w enables or disables tendf interrupt requests. 0: tendf interrupt requests are disabled. 1: tendf interrupt requests are enabled. 6 rende 0 r/w enables or disables rendf interrupt requests. 0: rendf interrupt requests are disabled. 1: rendf interrupt requests are enabled. 5 rcve3 0 r/w enables or disables rcvf3 interrupt requests. 0: rcvf3 interrupt requests are disabled. 1: rcvf3 interrupt requests are enabled.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 557 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 rcve2 0 r/w enables or disables rcvf2 interrupt requests. 0: rcvf2 interrupt requests are disabled. 1: rcvf2 interrupt requests are enabled. 3 rcve1 0 r/w enables or disables rcvf1 interrupt requests. 0: rcvf1 interrupt requests are disabled. 1: rcvf1 interrupt requests are enabled. 2 upe 0 r/w enables or disables upf interrupt requests. 0: upf interrupt requests are disabled. 1: upf interrupt requests are enabled. 1 ope 0 r/w enables or disables opf interrupt requests. 0: opf interrupt requests are disabled. 1: opf interrupt requests are enabled. 0 o ve 0 r/w enables or disables o vf interrupt requests. 0: o vf interrupt requests are disabled. 1: o vf interrupt requests are enabled. 15.3.7 stif transfer size register (stsizer) (n = 0,1) stsizer is a 32-bit register th at specifies a transfer byte count for ps mode. stsizer is initialized to h'ffffffff by a power-on reset. bit bit name initial value r/w description 31 to 0 size31 to size0 all 1 r/w transfer byte count for ps mode
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 558 of 1262 rej09b0437-0100 15.3.8 stifpwm mode register (stpwmmr) stpwmmr is a 32-bit register that selects pwm mode, sets pwm control cycle, reference bit shift amount, and reference clock, enables/disables pid filtering, and sets the pid of a pcr packet to be filtered. stpwmmr is initialized to h'00000000 by a power-on reset. bit bit name initial value r/w description 31 to 29 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 28 to 16 pid12 to pid0 all 0 r/w these bits set the pid (p cr_pid) of filtering target pcr packet. 15 piden 0 r/w enables or dis ables pcr packet filtering. 0: filtering is disabled. 1: filtering is enabled. 14 pwmuen 0 r/w selects whether to reflect the pwm control difference (internal stc - internal pcr) in the pwm control output according to the comparison of the residual upper bits (comparison target bits) in the comparison of bits 0 to 11. the comparison result of target bits is reflected in unzf. this bit is valid only when pwmsel is 0. 0: when the comparison results in a mismatch, pwm control variable is reflected in pwm control. [match: unzf = 0] pwm control variable is reflected in pwm output control. [mismatch: unzf = 1] pwm control variable is reflected in pwm output control. 1: when the comparison results in a mismatch, pwm control variable is not reflected in pwm control. [match: unzf = 0] pwm control variable is reflected in pwm output control. [mismatch: unzf = 1] pwm control variable is not reflected in pwm output control.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 559 of 1262 rej09b0437-0100 bit bit name initial value r/w description 13 pwmsel 0 r/w selects difference (internal stc - internal pcr) result or pwmr value for use as the input to selector 2 (figure 15.9). also selects pcr arrival pulse or pwmwp as the pulse for reflecting the selector 2 output in the pwm output. 0: pwm control mode is set for the difference (internal stc - internal pcr) result control. pcr arrival pulse and pwmwp are available. 1: pwm control mode is set for the pwmr control. only pwmwp is available. 12 pwmsel2 0 r/w selects selector 1 (fi gure 15.9) or addition (selector 1 output + internal pwm) result for use as input to the internal pwm. 0: selector 1 output is set for input to the internal pwm. 1: addition (selector 1 output + internal pwm) result is set for input to the internal pwm. 11 10 9 8 pwmcyc3 pwmcyc2 pwmcyc1 pwmcyc0 0 0 0 0 r/w r/w r/w r/w these bits set a pwm cont rol cycle value based on the pwm reference clock that is set by the pwmdiv bits. see table 15.2. this setting should be modified only when the piden bit is 0. 7 6 5 4 pwmsft3 pwmsft2 pwmsft1 pwmsft0 0 0 0 0 r/w r/w r/w r/w these bits set a reference bit pos ition that is used to specify the pwm control variable (internal stc - internal pcr). as shown in figure 15.9, the refe rence bit position of the pwm control variable varies with the pwmsft value. this setting should be modified only when the piden bit is 0. reference bit position reference bit position 0000: 0 1000: 8 0001: 1 1001: 9 0010: 2 1010: 10 0011: 3 1011: 11 0100: 4 1100: 12 0101: 5 1101: 13 0110: 6 1110: 14 0111: 7 1111: 15
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 560 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 2 1 0 pwmdiv3 pwmdiv2 pwmdiv1 pwmdiv0 0 0 0 0 r/w r/w r/w r/w these bits set the reference clock of the pwm control output (pwmout) as a system clock (b ) division count. set a division count between 1 and 1024. if a value outside the range is set, the operation of this lsi is not guaranteed. this setting should be modified only when the piden bit is 0. 0000: 1 1000: 256 0001: 2 1001: 512 0010: 4 1010: 1024 0011: 8 1011: 2048 (invalid) 0100: 16 1100: 4096 (invalid) 0101: 32 1101: 8192 (invalid) 0110: 64 1110: 16384 (invalid) 0111: 128 1111: 32768 (invalid)
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 561 of 1262 rej09b0437-0100 table 15.2 pwm control cycle bits 11 to 8 description pwmcyc3 to pwmcyc0 pwm cycle ( pwm reference clock) acceptable comparison bit count n acceptable comparison (internal stc - internal pcr) result range * 1 pwm control variable * 2 (ilgl = 1) 0000 2 0 ? ? 0001 4 1 ?1 to +1 ?2 0010 8 2 ?3 to +3 ?4 0011 16 3 ?7 to +7 ?8 0100 32 4 ?15 to +15 ?16 0101 64 5 ?31 to +31 ?32 0110 128 6 ?63 to +63 ?64 0111 256 7 ?127 to +127 ?128 1000 512 8 ?255 to +255 ?256 1001 1024 9 ?511 to +511 ?512 1010 2048 10 ?1023 to +1023 ?1024 1011 4096 11 ?2047 to +2047 ?2048 1100 8192 12 ?4095 to +4095 ?4096 1101 16384 13 ?8191 to +8191 ?8192 1110 32768 14 ?16383 to +16383 ?16384 1111 65536 15 ?32767 to +32767 ?32768 notes: 1. when pwmsel = 0, if the comparison (i nternal stc - internal pcr) result exceeds the acceptable comparison result range, the unzf bit is set to 1. 2. if the pwm control variable is -(2^n), it is treated as an invalid pwm control variable (ilgl = 1) and the unzf bit is set to 1. t he pwm control variable is selected by the pwmsel bit.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 562 of 1262 rej09b0437-0100 15.3.9 stifpwm control register (stpwmcr) stpwmcr is a 32-bit register that specifies the generation of write pulses of the internal pcr and stc registers. stpwmcr is initialized to h'00000000 by a power-on reset. bit bit name initial value r/w description 31 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 stcxp 0 r/w setting this bit to 1 causes the stc value to be transferred to ststc0r and ststc1r. this bit is automatically cleared to 0. 7 pwmbrs 0 r/w setting this bit to 1 causes the internal pwm register value to be transferred to stpwm (pwmb). this bit is automatically cleared to 0. 6 pwmbwp 0 r/w setting this bit to 1 causes the stpwm (pwmb) value to be reflected in pwm. pwm control is immediately pe rformed with the value that is set in pwm. loading with this bit can preferentially be performed independently of the pwmsel and pwmuen settings, except when the pwm control variable is an invalid value as described in the unzf bit field of ststr. if this bit is set to 1 together with the pwmwp bit, pwmbwp takes precedence. this bit is automatically cleared to 0. 5 pwmrs 0 r/w setting this bit to 1 causes the difference (internal stc - internal pcr) result to be transferred to stpwm (pwm). the difference result is masked by the pwmcyc bits (validity comparison bits) of stpwmmr as shown in figure 15.9. this bit is automatically cleared to 0.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 563 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 pwmwp 0 r/w setting this bit to 1 causes the selector 2 output to be reflected in pwm. loading with this bit can be performed preferentially without depending on the pwmsel and pwmuen settings, except when the pwm control variable is an invalid value as described in the unzf bit field of ststr. if this bit is set to 1 together with the pwmwp bit, pwmbwp takes precedence. this bit is automatically cleared to 0. 3 stcrs 0 r/w setting this bit to 1 causes the stc value to be transferred to ststc0r and ststc1r. this bit is automatically cleared to 0. 2 stcwp 0 r/w setting this bit to 1 causes the ststc0r and ststc1r values to be transferred to stc. if the transfer conflicts with the data write after pcr is received, the transfer using the write pulse of this register takes precedence. this bit is automatically cleared to 0. 1 pcrrs 0 r/w setting this bit to 1 causes the pcr value to be transferred to stpcr0r and stpcr1r. this bit is automatically cleared to 0. 0 pcrwp 0 r/w setting this bit to 1 causes the stpcr0r and stpcr1r values to be transferred to pcr. if the transfer conflicts with the data write after pcr is received, the transfer using the write pulse of this register takes precedence. this bit is automatically cleared to 0.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 564 of 1262 rej09b0437-0100 15.3.10 stifpwm register (stpwmr) stpwmr is a 32-bit register that directly sets pwm control variable. stpwmr is initialized to h'00000000 by a power-on reset. bit bit name initial value r/w description 31 to 16 pwmb15 to pwmb0 all 0 r/w these bits set a pwm control value equivalent to the comparison (internal stc - internal pcr) result. to reflect the pwmb value in the pwmout output pin as a pwm control variable, set the pwmbwp bit in stpwmcr to 1. set a pwmb value of two's complement (bit n = sign bit) out of the acceptable comparison bit count n specified by the pw mcyc bits. the acceptable setting range is -(2^n - 1) to +(2^n - 1) where n = acceptable comparison bit count specified by the pwmcyc bits. do not set the value -(2^n). if -(2^n) is set and is attempted to reflect in the pwm control by setting pwmbwp to 1, it is treated as an invalid pwm control variable setting and the unzf bit is set to 1. the setting is not reflected in the pwm control output. note that reflection in the pwm control output is not performed until pwmb is set to a value other than -(2^n). 15 to 0 pwm15 to pwm0 all 0 r/w these bits set a pwm control value equivalent to the comparison (internal stc - internal pcr) result. to reflect the pwm value in the pwmout output pin as a pwm control variable, set the pwmwp bit in stpwmcr to 1 with pwmsel = 1. set a pwm value of two's complement (bit n = sign bit) out of the acceptable comparison bit count n specified by the pwmcyc bits. the acceptable setting range is -(2^n - 1) to +(2^n - 1) where n = acceptable comparison bit count specified by the pwmcyc bits. set a value so that the selector 2 output is not the value -(2^n). when the selector 2 output is -(2^n) and the pwm value is reflected in the pwm control by setting pwmwp to 1, the pwm value is treated as an invalid pwm control variable setting and the unzf bit is set to 1, the setting is not reflected in the pwm control output.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 565 of 1262 rej09b0437-0100 15.3.11 stifpcr0, stifpcr01 registers (stpcr0r, stpcr1r) stpcr0r and stpcr1r are 32-bit registers that interface with the internal pcr register. stpcr0r and stpcr1r are initialized to h'000000 00 by a power-on reset. these registers compose a 42-bit register includi ng pcr base (33 bits) and pcr extension (9 bits). the pcr base and pcr extension are stored in pcrb32 to p crb0 and pcrx8 to pcrx0 respectively. reading or writing this 42-bit register does not cause the read/write result to be reflected directly in clock recovery. ? stpcr0r bit bit name initial value r/w description 31 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 to 0 pcrb32 to pcrb23 all 0 r/w pcr base ? stpcr1r bit bit name initial value r/w description 31 to 9 pcrb22 to pcrb0 all 0 r/w pcr base 8 to 0 pcrx8 to pcrx0 all 0 r/w pcr extension note: if pcr_pid arrives during data read, the r ead value is overwritten and becomes undefined. therefore, confirm that there is no pcr_pid during data r ead with the pcrf bit in ststr. specifically, set the pcrf bit to 0 and then start reading the receive data. whenever pcrf is 1, take this procedure.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 566 of 1262 rej09b0437-0100 15.3.12 stifstc0, stifstc1 re gisters (ststc0r, ststc1r) ststc0r and ststc1r are 32-bit registers that interface with the internal stc register. stpcr0r and stpcr1r are initialized to h'00000000 by a power-on reset. these registers compose a 42-bit register including stc base (33 bits) and stc extension (9 bits). the pcr base and pcr extension are stored in stcb32 to st cb0 and stcx8 to stcx0 respectively. reading or writing this 42-bit register does not cause the read/write result to be reflected directly in clock recovery. ? ststc0r bit bit name initial value r/w description 31 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 to 0 stcb32 to stcb23 all 0 r/w stc base ? ststc1r bit bit name initial value r/w description 31 to 9 stcb22 to stcb0 all 0 r/w stc base 8 to 0 stcx8 to stcx0 all 0 r/w stc extension note: if pcr_pid arrives during data read, the r ead value is overwritten and becomes undefined. therefore, confirm that there is no pcr_pid during data r ead with the pcrf bit in ststr. specifically, set the pcrf bit to 0 and then start reading the receive data. whenever pcrf is 1, take this procedure.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 567 of 1262 rej09b0437-0100 15.3.13 stif lock control register (stlkcr) stlkcr is a 32-bit register to control pll frequency lock. stlkcr is initialized to h'00000000 by a power-on reset. bit bit name initial value r/w description 31 to 26 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 25 lkwp 0 r/w setting this bit to 1 causes the lkcnt value to be reflected in the internal lkcnt. if this operation conflicts wit h the count up or clear operation of the internal lkcnt, writing by lkwp takes precedence. this bit is automatically cleared to 0. 24 ulwp 0 r/w setting this bit to 1 causes the ulcnt value to be reflected in the internal ulcnt. if this operation conflicts wit h the count up or clear operation of the internal ulcnt, writing by ulwp takes precedence. this bit is automatically cleared to 0. 23 22 21 20 ulcnt3 ulcnt2 ulcnt1 ulcnt0 0 0 0 0 r/w r/w r/w r/w setting ulwp to 1 causes the ulcnt value to be written to the internal ulcnt. when read, these bits indicate the state below. - the count of continuous lk zf = 1 states (outside the threshold value range) in the pll lock state (lkf = 1) these bits are cleared to 0 when (1) ulcnt >= ulref (when lkf = 1, it is cleared to 0), (2) the ulcnt value falls within the threshold value range (lkzf = 0), or (3) "discont" occurs. 19 18 17 16 lkcnt3 lkcnt2 lkcnt1 lkcnt0 0 0 0 0 r/w r/w r/w r/w setting lklp to 1 causes the lkcnt value to be written to the internal lkcnt. when read, these bits indicate the state below. - the count of continuous lk zf = 0 states (within the threshold value range) in the pll unlock state (lkf = 0) these bits are cleared to 0 when (1) lkcnt >= lkref (when lkf = 0, it is set to 1) , (2) the lkcnt value exceeds the threshold value range (lkzf = 1), or (3) "discont" occurs.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 568 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 14 13 12 gain3 gain2 gain1 gain0 0 0 0 0 r/w r/w r/w r/w these bits are used to contro l the right-shift amount that gains the error amount to be input to the adder from selector 1. since the error am ount is expressed as a two's complement, an arithmetic shi ft is used for right shift. that is, the most significant sign bit is copied to the bits that become short by the right shift for refill. select a value between 0 and 10 for the right-shift amount of error amount. if a value outside the range is set, the setting is invalid and the operation is not guaranteed. right-shift amount right-shift amount 0000: 0 1000: 8 0001: 1 1001: 9 0010: 2 1010: 10 0011: 3 1011: 11 (invalid) 0100: 4 1100: 12 (invalid) 0101: 5 1101: 13 (invalid) 0110: 6 1110: 14 (invalid) 0111: 7 1111: 15 (invalid) 11 10 9 8 lkcyc3 lkcyc2 lkcyc1 lkcyc0 0 0 0 0 r/w r/w r/w r/w these bits set a pll lock threshold value. for pll lock threshold values, see table 15.3.13. set an lkcyc value that is not larger than pwmcyc (lkcyc =< pwmcyc). if a value larger than pwmcyc is set, the operation is not guaranteed. 7 6 5 4 ulref3 ulref2 ulref1 ulref0 0 0 0 0 r/w r/w r/w r/w these bits specify a reference value for the number of continuous lkzf = 1 states ( outside the threshold value range) when pll is locked (lkf = 1). this value is compared with the ulcnt value. when ulcnt >= ulref, the lkf bit in ststr is set to 0. 3 2 1 0 lkref3 lkref2 lkref1 lkref0 0 0 0 0 r/w r/w r/w r/w these bits specify a reference value for the number of continuous lkzf = 0 states (within the threshold value range) when pll is unlocked (lkf = 0). this value is compared with the lkcnt value. when lkcnt >= lkref, the lkf bit in ststr is set to 1.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 569 of 1262 rej09b0437-0100 table 15.3 pll lock threshold value bits 11 to 8 description lkcyc3 to lkcyc0 pll lock threshold value ( pwm reference clock) acceptable comparison bit count n acceptable comparison (internal stc - internal pcr) result range * 1 pwm control variable * 2 (ilgl = 1) 0000 2 0 ? ? 0001 4 1 ?1 to +1 ?2 0010 8 2 ?3 to +3 ?4 0011 16 3 ?7 to +7 ?8 0100 32 4 ?15 to +15 ?16 0101 64 5 ?31 to +31 ?32 0110 128 6 ?63 to +63 ?64 0111 256 7 ?127 to +127 ?128 1000 512 8 ?255 to +255 ?256 1001 1024 9 ?511 to +511 ?512 1010 2048 10 ?1023 to +1023 ?1024 1011 4096 11 ?2047 to +2047 ?2048 1100 8192 12 ?4095 to +4095 ?4096 1101 16384 13 ?8191 to +8191 ?8192 1110 32768 14 ?16383 to +16383 ?16384 1111 65536 15 ?32767 to +32767 ?32768 notes: 1. when the comparison (internal stc - in ternal pcr) result falls within the acceptable comparison result range, the lkzf bit is set to 0. 2. if the pwm control variable is -(2^n), it is treated as an invalid pwm control variable (ilgl = 1) and the lkzf bit is set to 1. t he pwm control variable is selected by the pwmsel and pwmsel2 bits.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 570 of 1262 rej09b0437-0100 15.3.14 stif debugging st atus register (stdbgr) stdbgr is a 32-bit register that indicates the first four bytes of an input or output packet. stdbgr is provided for debugging. the write value should always be 0. bit bit name initial value r/w description 31 to 0 stmon31 to stmon0 all 0 r the 4-byte timestamp of a packet that is input or output in ts mode is stored. 15.4 examples of clock connection to another device examples of clock connection to another device are illustrated below. 15.4.1 a basic example another device this lsi clkout ( output) clkin ( input) syc ( input/output) vld ( input/output) d[7:0] ( input/output) st0_clkin ( input) st_clkout ( output) stn_syc ( input/output) stn_vld ( input/output) stn_d[7:0] ( input/output) (n = 0, 1) ? when this lsi receives a stream, it is r eceived in synchronizat ion with stn_clkin. ? when this lsi sends a stream, it is sent in synchronization with st_clkout. 15.4.2 an example of clock connection when another device has no clock input another device this lsi clkout ( output) syc ( input/output) vld ( input/output) d[7:0] ( input/output) st0_clkin ( input) st_clkout ( output) stn_syc ( input/output) stn_vld ( input/output) stn_d[7:0] ( input/output) open (n = 0, 1) ? when this lsi receives a stream, it is r eceived in synchronizat ion with stn_clkin. ? when this lsi sends a stream, it is sent in synchronization with stn_clkin.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 571 of 1262 rej09b0437-0100 15.4.3 an example of clock connection when another device has no clock output another device this lsi clkin ( input) syc ( input/output) vld ( input/output) d[7:0] ( input/output) stn_clkin ( input) st_clkout ( output) stn_syc ( input/output) stn_vld ( input/output) stn_d[7:0] ( input/output) (n = 0, 1) ? when this lsi receives a stream, it is r eceived in synchronizat ion with stn_clkin. ? when this lsi sends a stream, it is sent in synchronization with st_clkout. 15.5 input/output timing figures 15.2 to 15.7 show the operation overview and inpu t/output timing of each mode.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 572 of 1262 rej09b0437-0100 sh stif +4 byte timestamp added 192 byte sh local bus 188 byte push control system syc, vld, d sh stif -4 byte timestamp removed output control according to timestamp 192 byte sh local bus 188 byte req push control system syc, vld, d schematic diagram of ts mode 1 and ts mode 2 sh stif +4 byte timestamp added 192 byte sh local bus 188 byte pull control system syc, vld, d sh stif -4 byte timestamp removal only data output control according to req input 192 byte sh local bus 188 byte pull control system syc, vld, d schematic diagram of ts mode 3 sh stif file transfer image no timestamp is added or removed. 192 bytes fixed 192 byte sh local bus 192 byte pull control system vld, d sh stif file transfer image no timestamp is added or removed. 192 bytes fixed data output control according to req input 192 byte sh local bus 192 byte pull control system vld, d schematic diagram of tts mode sh stif file transfer image no timestamp is added or removed. transfer size is determined by size register. file transfer image no timestamp is added or removed. transfer size is determined by size register. data output control according to req input n byte (n: integer) sh local bus n by te (n: integer) pull control system vld, d sh stif n byte (n: integer) sh local bus n by te (n: integer) pull control system vld, d schematic diagram of ps mode req req req req req figure 15.2 operation overview
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 573 of 1262 rej09b0437-0100 clk (input) ts serial mode 1 (input) syc (input) vld (input) d[0] (input) bit 1 - bit 1 - - bit 1504 invalid vld receivable (ignored) invalid vld receivable (ignored) must be asserted continuously one or more negation cycles clk (output) ts serial mode 1 (output) syc (output) vld (output) d[0] (output) bit 1 - bit 1 - - bit 1504 one or more negation cycles clk (input) ts parallel mode 1 (input) syc (input) vld (input) d[7:0] (input) 1 byte - 1 byte - - byte 188 must be asserted continuously one or more negation cycles clk (output) ts parallel mode 1 (output) syc (output) vld (output) d[7:0] (output) 1 byte - 1 byte - - byte 188 one or more negation cycles note: valid data invalid data figure 15.3 ts mode 1
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 574 of 1262 rej09b0437-0100 bit 1 - bit 1 - - bit 1504 clk (input) ts serial mode 2 (input) syc (input) vld (input) d[0] (input) bit 1 - - bit 1 - - bit 1504 can be continuous or separate. invalid vld receivable (ignored) can be continuous or separate. one-cycle assertion and continuous assertion (until 188-byte transfer end) are both acceptable. clk (output) ts serial mode 2 (output) syc (output) vld (output) d[0] (output) clk (input) ts parallel mode 2 (input) syc (input) vld (input) d[7:0] (input) clk (output) ts parallel mode 2 (output) syc (output) vld (output) d[7:0] (output) note: valid data invalid data one or more negation cycles asserted for 8 bits 1 byte - 1 byte - - byte 188 1 byte - - 1 byte - - byte 188 can be continuous or separate. invalid vld receivable (ignored) can be continuous or separate. one-cycle assertion and continuous assertion (until 188-byte transfer end) are both acceptable. one or more negation cycles syc must be negated for at least one cycle. vld need not be negated. vld need not be negated. syc must be negated for at least one cycle. figure 15.4 ts mode 2
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 575 of 1262 rej09b0437-0100 can be continuous or separate. clk (input) ts serial mode 3 (input) req (output) syc (input) vld (input) d[0] (input) clk (output) ts serial mode 3 (output) req (input) syc (output) vld (output) d[0] (output) note: valid data invalid data bit 1 - no restriction for input latency bit 1 - - bit 1504 bit 1 - bit 1 - - bit 1504 min 1cyc can be continuous or separate. clk (input) ts parallel mode 3 (input) req (output) syc (input) vld (input) d[7:0] (input) 1 byte - no restriction for input latency 1 byte - - byte 188 clk (output) ts parallel mode 3 (output) req (input) syc (output) vld (output) d[7:0] (output) 1 byte - 1 byte - - byte 188 min 1cyc minimum 2-clock latency from vld input negation (bit 1504) until req output negation minimum 1-clock latency from vld input negation (byte 188) until req output negation up to 1-bit overrun from req input negation until vld output negation up to 1-bit overrun from req input negation until vld output negation figure 15.5 ts mode 3
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 576 of 1262 rej09b0437-0100 clk (input) tts serial mode (input) req (output) vld (input) d[0] (input) no restriction for input latency overrun for up to 7 bits allowable note: valid data invalid data clk (output) tts serial mode (output) req (input) vld (output) d[0] (output) min 1cyc overrun for up to 1 bit clk (input) tts parallel mode (input) req (output) vld (input) d[7:0] (input) no restriction for input latency overrun for up to 3 bytes allowable clk (output) tts parallel mode (output) req (input) vld (output) d[7:0] (output) min 1cyc overrun for up to 1 byte figure 15.6 tts mode
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 577 of 1262 rej09b0437-0100 clk (input) ps serial mode (input) req (output) vld (input) d[0] (input) no restriction for input latency overrun for up to 7 bits allowable note: valid data invalid data clk (output) ps serial mode (output) req (input) vld (output) d[0] (output) min 1cyc overrun for up to 1 bit clk (input) ps parallel mode (input) req (output) vld (input) d[7:0] (input) no restriction for input latency overrun for up to 3 bytes allowable clk (output) ps parallel mode (output) req (input) vld (output) d[7:0] (output) min 1cyc overrun for up to 1 byte figure 15.7 ps mode
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 578 of 1262 rej09b0437-0100 15.6 pcr clock recovery module (pcrrcv) the pcr clock recovery module (pcrrcv) is a circuit to provide a pwm (pulse wave modulation) output for c ontrolling the external vcxo circu it according to the difference between 42-bit program_clock_reference (pcr) and system reference clock (stc). the pcr consists of program_colck_reference_base (pcr base) and program_clock_reference_extension (pcr extension) of adaptation_field in an input transport (ts) packet. the pcrrcv has the following features. ? a 42-bit internal stc counter triggered by the clock input from the external vcxo circuit ? pwm output for controlling the external vcxo circuit can be output on the stn_pwmout pin. ? vcxo control is selectable from pwm control mode according to the difference between pcr and stc in a ts packet or pwm control mode by directly setting stpwmr. ? pwm control accuracy and pwm cycle can be set in stpwmmr. pcrrcv [legend] vcxo: lpf: pwmout: voxo (27mhz): vcxo clock input pin low pass filter pwm control output pin voltage control oscillator voxo (27mhz) vcxo lpf pwmout figure 15.8 stn_vco_clkin and stn_pwmout connections
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 579 of 1262 rej09b0437-0100 15.6.1 operation of pcr clock recovery internal pcr internal pcr and stc values are binary-converted, and then the difference between them is calculated. (32 bits) pcr base (16 bits) selector 1 selector 2 (16 bits) (9 bits) pcr ext pwmcyc+1 pwmcyc+1 pwmcyc+1 pwmcyc+1 cycle: pwmcyc pwmdiv pwmout high pwmout low pwmcyc+1 pwmsft pwmsel pwmsel2 gain internal stc stc value - pcr value internal pwm right shift lkzf unzf pwmr pwmbr upper-side comparison target upper-side comparison target sign bit n is refilled by right-shift. (n: acceptable comparison bit count specified by pwmcyc) pwmout high = (inverse value of pwm control variable (except msb) + 1) pwmdiv pwmout low = (pwmcyc - pwmout high) pwmdiv pwmout output waveform lkcyc+1 (16 bits) (16 bits) figure 15.9 illustrati on of register settings
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 580 of 1262 rej09b0437-0100 ? register settings a. specify the acceptable comparison bit coun t n of the pwm control variable using the pwmcyc3 to pwmcyc0 bits in stpwmmr. b. set a pll lock threshold value using the lkcyc3 to lkcyc0 bits in stlkcr. c. specify the shift amount of the pwm control variable reference bit (lsb of pwm control variable) using the pwmsft3 to pwmsft0 bits in stpwmmr. the shifted bits (pwmsft width bits in figure 15.9) do not fall within the pwm control variable comparison range. d. in the pwm control variable calculation, th e pcr base and pcr exte nsion of the internal stc and pcr registers are converted to bina ry values, and the converted values are masked with the pwmsft width bits, and then the difference between the values is calculated. the binary conversion is performed using the following expression (1). internal stc/pcr binary conversion: (pcr_base 300 + pcr_ext) & (pwmsft width mask) ?(1) the upper comparison result except (pwmcyc + 1) of the difference result is reflected in the unzf bit in ststr. the upper comparison result except (lkcyc + 1) of the difference result is reflected in the lkzf bit in ststr. e. specify the right-shift amount of selector 1 output using the gain3 to gain0 bits in stlkcr. since an arithmetic shift is used fo r the right shift, the overflowing bits are discarded on the lower side and the sign bit (bit n when the accep table comparison bit count = n) is refilled on the upper side. f. switch selector 1 and selector 2 using the pwmsel and pwmsel2 bits in stpwmmr to select the path to the internal pwm register. g. specify the pwm reference clock of the pwmout pin using the pwmdiv3 to pwmdiv0 bits in stpwmmr. the pwm referen ce clock has a cycle of system clock pwmdiv. the pwm cycle of the pwmout pin has a clock cycle of pwmcyc pwmdiv. h. the pwmout output waveform that depends on the pwm control variable is as follows: pwmout high = (iinverse value of pwm control variable (except msb) + 1) pwmdiv ?(2a) pwmout low = (pwmcyc - pwmout low) pwmdiv ?(2b) when the acceptable comparison bit count is n, the msb becomes bit n of the pwm control variable. the pwm control variable is expressed as a two's complement. whether to include the upper comparison target in the pwm control range is specified by the pwmuen bit in stpwmmr.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 581 of 1262 rej09b0437-0100 i. the pwm control variable can directly be set by stpwmr when the pwmsel bit in stpwmmr is set to 1. in this case, pwmcyc acts as a number of acceptable comparison bits as in the case of internal stc value - pcr value (figure 15.9). 15.6.2 pcr clock recovery operation pcrrcv pcr_pid setting figure 17.6 ts packet arrival time to internal pcr bus packet including pcr_pid (packet with pid set by pcr_pid) input to pcrrcv upon arrival of pcr ... ... pcr0 pcr1 pcr2 figure 15.10 overvi ew of ts packet ? example 1: clock recovery using the pcrrcv hardware a. set pwmsel to 0 to enable the clock recovery using the pcrrcv hardware. b. set the pwmcyc, pwmsft, pwmdiv, and pwmuen bits in stpwmmr for the pwm control output. c. set the pid bits in stpwmmr to pcr_pid of a packet including pcr for recovering clock to the pcrrcv. the clock recovery starts upon the pid setting. for this reason, if the pcr continuity is impaired by a reset or channel change, set piden to 0 and then set a pid. d. when a packet including pcr_pid arrives, the pcrrcv extracts the 42-bit program_clock_reference (pcr) from the adap tation_field of the packet. for packet conditions for extracting pcr, see table 15.4. when a ts packet that satisfies the conditions in table 15.4 arrives, a pcr arrival pulse is generated in the pcrrcv. e. when a pcr arrival pulse is generated, the p cr extracted from the pack et is transferred to the internal pcr register and stc counte r. the stc counter (stc) value is also transferred to the internal stc register at the same time. after that, the stc counter starts counting by the vcxo clock input. the stc co unter value incremented from the previous pcr until the present time by the vcxo clock is set in the internal stc register, and the currently arrived pcr is set in the internal pcr register and stc counter. f. the pwm control variable, which is the comparison result between the internal stc and pcr registers (stc value - pcr value), is calculated by the pwmcyc, pwmsft, and pwmdiv bits in stpwmmr. when the comparison result reflection conditions in table 15.5 are satisfied, the comparison result is reflected in the pwm output control. setting
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 582 of 1262 rej09b0437-0100 pwmuen to 1 disables the pwm control va riable outside the acce ptable comparison result range specified by the pwmcyc bits to be reflected in the pwm control output. this function can prevent an abnormal pcr (caused by pcr error due to transmission error or protocol violation at the transmitter side) from being reflected in clock recovery. for measures against abnormal pcrs, see the pr ocedure examples 1 and 2 described later. g. the pwmout waveform with a reflected pwm control variable is output from the pwmout pin as shown in figure 15.9. h. the internal stc and pcr register values are compared each time a pcr_pid packet arrives. by configuring a feedback circuit including an external low-pass filter (lpf) and an external vcxo, which makes the comparison (stc value - pcr value) result to be 0, the vcxo clock frequency is adjusted. ? example 2: clock recovery using the pcrrcv and software a. set pwmsel to 1 to disable the clock r ecovery using the pcrrcv hardware. also set pcre to 1 to enable interrupt reques ts made by each pcr arrival pulse. b. the pcrrcv settings and tran sfers of the pcrrcv internal registers are the same as those described in steps 2 to 5of example 1. notes 1 to 4 for table 15.5 apply to the case of the first arrival of pcr after the pcr continui ty is lost. since the stc counter that has no continuity with the arrived internal pcr register is transferred to the internal stc register, it is not appropriate to calcu late the difference (stc value - pcr value) by the cpu. c. confirm that transfer betw een the pcrrcv internal registers has been completed (pcrf = 1), and then set pcrf to 0. after that, se t the stcrs and pcrrs bits to 1 to enable transfer from the stc register to ststc0r and ststc1r, as well as transfer from the pcr register to ststc0r and ststc1r. then read ststc0r/ststc1r and stpcr0r/stpcr1r. furthermore, to obtain the stc counter value for setting to the mpeg2 decoder, set the stcxp bit to 1 to enable transfer from the stc counter to ststc0r and ststc1r. then read ststc0r and ststc1r. d. a pcrf read value of 0 means that no p cr_pid packet arrived during the register read stage in step 3. this shows that the reading of ststc0r/ststc1r and stpcr0r/stpcr1r in step 3 was successful. on the other hand, a pcrf read value of 1 shows an arrival of pcr_pid packet during the register read stage in step 3. it is not certain that the read ststc0r/ststc1r an d stpcr0r/stpcr1r are the values of the internal stc and pcr registers that arrived previously or those that arrived during the register read stage. therefore, go back to step 3 and repeat the procedure.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 583 of 1262 rej09b0437-0100 e. the cpu converts the read ststc0r/ststc1r and stpcr0r/stpcr1r values to binary ones with stcbin and pcrbin respectively using the expression (1) in section 15.6.1, operation of pcr clock recovery, st ep 4, and then calculates the difference (stcbin - pcrbin). to be set in stpwmr as a pwm control variable, specify the difference (stcbin - pcrbin) as a two's co mplement of the acceptable comparison bit count n (n: sign bit) specified by the pwmcyc bits. set a value within the range of -(2^n - 1) to +(2^n - 1) for the difference. do not set the value -2^n. the cpu also determines the handling of pcr data errors shown in step 6of example 1. f. the pwm control variable that is set in stpwmr can be reflected in the pwm control output by writing 1 to pwmwp. g. for the principle of vcxo clock frequency adjustment using the pwm control output, the descriptions in steps 7 and 8 of example 1 apply. table 15.4 pcr extraction conditions transport_error_ indicator adaptation_field_ control adaptation_field_length p cr_flag pcr extraction * 00 don't care don't care impossible 01 don't care don't care impossible 0 len < 7 don't care impossible 0 impossible 10 7 len < h'ff 1 possible 0 len < 7 don't care impossible 0 impossible 0 11 7 len < h'ff 1 possible 1 don't care don't care don't care impossible note: * when pcr extraction is possible, pcr is extracted and a pcr arrival pulse is generated.
section 15 stream interface (stif) rev. 1.00 nov. 14, 2007 page 584 of 1262 rej09b0437-0100 table 15.5 internal pcr and stc registers comparison result reflection conditions * 1 reflection comparison resu lt reflection conditions not reflected * 2 arrival of pcr_pid after "discont" * 3 arrival of pcr_pid whose upper comparison result does not match when pwmuen = 1 reflected arrival of pcr_pid in other cases notes: 1. when pwmsel = 0, the reflection condit ions in this table are effective. when pwmsel = 1, the pwm control variable can be reflect ed in the pwm control output by writing 1 to the pwmwp bit. 2. since the pwm control variable is not re flected, the pwmout wa veform is maintained. 3. there are four patterns of pcr_pid arrival after "discont." (1) the first pcr_pid arriva l after reset cancellation (2) the first pcr_pid arrival after pcr flush cancellation (3) when discontinuity_indicator of the arrived pcr_pid packet = 1 (4) arrival of pcr_pid after the pid bits in stpwmmr was modified * 4 4. set piden to 0 before modifying the pid bi ts in stpwmmr. with th is setting, arrival of pcr_pid is treated as a rrival after "discont." ? hardware measures against arrival of abnormal pcrs initial setting (1) set an lkcyc value not larger than the pwmcyc value. the lkcyc value must be larger than the steady-state de viation (error amount) of the pll that is configured with an external circuit. determin e the lkcyc value with a margin from the pll's steady-state deviation. otherwise, the operation of this lsi is not guaranteed. initial setting (2) set an lkref value until the lkf bit is set to 1 when the pll error amount falls within the threshold value range. the lkref bits, which are usually set to 1, are provided for setting to enhance the stability against arrival of abnormal pcrs in the pll pull- in state. note that the larger the lkref value b ecomes, the higher stability is obtained, but the pll pull-in time becomes longer. initial setting (3) set a ulref value until the lkf bit is set to 0 when the pll error amount exceeds the threshold value limit. the ulref bits, which are usually set to 1, are provided for setting to enhance the stability against arrival of abnormal pcrs in the pll lock state. it is recommended that the lkref value be larger th an the maximum of the number of continuous arrivals of system-dependent abnormal pcrs.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 585 of 1262 rej09b0437-0100 section 16 serial sound interface (ssi) the serial sound interface (ssi) is a module designed to send or receive a udio data interface with various devices offering philips format compatibility . it also provides additional modes for other common formats, as well as support for multi-channel mode. 16.1 features ? number of channels: two channels ? operating mode: non-compressed mode the non-compressed mode supports serial audio streams divided by channels. ? serves as both a transmitter and a receiver ? capable of using serial bus format ? asynchronous transfer takes place between the data buffer and the shift register. ? it is possible to select a value as the dividing ra tio for the clock used by the serial bus interface. ? it is possible to control data transmission or reception with dmac and interrupt requests. ? selects the oversampling clock input from among the following pins: extal, xtal (clock operation mode 0) ckio (clock operation modes 1 and 2) audio_clk figure 16.1 shows a schematic diagram of the four channels in the ssi module. audio_clk ssiws0 ssisck0 ssi0 ssidata0 extal xtal ckio ssiws1 ssisck1 ssi1 ssidata1 figure 16.1 schemati c diagram of ssi module
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 586 of 1262 rej09b0437-0100 figure 16.2 shows a block diagram of the ssi module. ssisck ssiws ssidata serial audio bus register ssicr ssisr ssitdr ssirdr ssi module dma request interrupt request peripheral bus data buffer barrel shifter control circuit bit counter serial clock control divider lsb msb shift register ckio oscillation circuit extal xtal audio_clk ssicr: ssisr: ssitdr: ssirdr: control register status register transmit data register receive data register legend: figure 16.2 block diagram of ssi
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 587 of 1262 rej09b0437-0100 16.2 input/output pins table 16.1 shows the pin assignments relating to the ssi module. table 16.1 pin assignments pin name number of pins i/o description ssisck0 1 i/o serial bit clock ssiws0 1 i/o word selection ssidata0 1 i/o serial data input/output ssisck1 1 i/o serial bit clock ssiws1 1 i/o word selection ssidata1 1 i/o serial data input/output audio_clk 1 input external clock for audio (entering oversampling clock 256/384/512fs)
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 588 of 1262 rej09b0437-0100 16.3 register description the ssi has the following registers. note that explanation in the text does not refer to the channels. table 16.2 register description channel register name abbrevia- tion r/w initial value address access size control register 0 ssicr_0 r/w h?00000000 h'fffec000 32 status register 0 ssisr_0 r/w * h?02000003 h'fffec004 32 transmit data register 0 ssit dr_0 r/w h?00000000 h'fffec008 32 0 receive data regist er 0 ssirdr_0 r h?00000000 h'fffec00c 32 control register 1 ssicr_1 r/w h?00000000 h'fffec800 32 status register 1 ssisr_1 r/w * h?02000003 h'fffec804 32 transmit data register 1 ssit dr_1 r/w h?00000000 h'fffec808 32 1 receive data regist er 1 ssirdr_1 r h?00000000 h'fffec80c 32 0 ssi clock selection register 0 scsr_0 r/w h?0000 h'ffff0000 16 1 ssi clock selection register 1 scsr_1 r/w h?0000 h'ffff0800 16 note: * although bits 26 and 27 in this register c an be read from or written to, bits other than these are read-only. for details, refer to se ction 16.3.2, status register (ssisr).
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 589 of 1262 rej09b0437-0100 16.3.1 control register (ssicr) ssicr is a readable/writable 32-bit register that co ntrols the irq, selects the polarity status, and sets operating mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r r/w r/w r/w r/w r r/w r/w bit: initial value: r/w: bit: initial value: r/w: - - - dmem uien oien iien dien chnl[1:0] dwl[2:0] swl[2:0] sckd swsd sckp swsp spdp sdta pdta del - ckdv[2:0] muen - trmd en bit bit name initial value r/w description 31 to 29 ? all 0 r reserved the read value is not guar anteed. the write value should always be 0. 28 dmen 0 r/w dma enable enables/disables the dma request. 0: dma request is disabled. 1: dma request is enabled. 27 uien 0 r/w underflow interrupt enable 0: underflow interrupt is disabled. 1: underflow interrupt is enabled. 26 oien 0 r/w overflow interrupt enable 0: overflow interrupt is disabled. 1: overflow interrupt is enabled. 25 iien 0 r/w idle mode interrupt enable 0: idle mode interrupt is disabled. 1: idle mode interrupt is enabled.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 590 of 1262 rej09b0437-0100 bit bit name initial value r/w description 24 dien 0 r/w data interrupt enable 0: data interrupt is disabled. 1: data interrupt is enabled. 23, 22 chnl[1:0] 00 r/w channels these bits show the number of channels in each system word. 00: having one channel per system word 01: having two channels per system word 10 having three channels per system word 11: having four channels per system word 21 to 19 dwl[2:0] 000 r/w data word length indicates the number of bits in a data word. 000: 8 bits 001: 16 bits 010: 18 bits 011: 20 bits 100: 22 bits 101: 24 bits 110: 32 bits 111: reserved 18 to 16 swl[2:0] 000 r/w system word length indicates the number of bits in a system word. 000: 8 bits 001: 16 bits 010: 24 bits 011: 32 bits 100: 48 bits 101: 64 bits 110: 128 bits 111: 256 bits
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 591 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 sckd 0 r/w serial bit clock direction 0: serial bit clock is input, slave mode. 1: serial bit clock is output, master mode. note: non-compressi on mode (cpen = 0) permits only the following settings: (sckd, swsd) = (0,0) and (1,1). other settings are prohibited. 14 swsd 0 r/w serial ws direction 0: serial word select is input, slave mode. 1: serial word select is output, master mode. note: non-compressi on mode (cpen = 0) permits only the following settings: (sckd, swsd) = (0,0) and (1,1). other settings are prohibited. 13 sckp 0 r/w serial bit clock polarity 0: ssiws and ssidata change at the ssisck falling edge (sampled at the sck rising edge). 1: ssiws and ssidata change at the ssisck rising edge (sampled at the sck falling edge). sckp = 0 sckp = 1 ssidata input sampling timing at the time of reception (trmd = 0) ssisck rising edge ssisck falling edge ssidata output change timing at the time of transmission (trmd = 1) ssisck falling edge ssisck rising edge ssiws input sampling timing at the time of slave mode (swsd = 0) ssisck rising edge ssisck falling edge ssiws output change timing at the time of master mode (swsd = 1) ssisck falling edge ssisck rising edge 12 swsp 0 r/w serial ws polarity 0: ssiws is low for 1st channel, high for 2nd channel. 1: ssiws is high for 1st channel, low for 2nd channel.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 592 of 1262 rej09b0437-0100 bit bit name initial value r/w description 11 s pdp 0 r/w serial padding polarity 0: padding bits are low. 1: padding bits are high. note: when muen = 1, the padding bit becomes low (the mute function takes precedence). 10 sdta 0 r/w serial data alignment 0: transmitting and receiving in the order of serial data and padding bits 1: transmitting and receiving in the order of padding bits and serial data 9 pdta 0 r/w parallel data alignment this bit is ignored if cpen = 1. when the data word length is 32, 16 or 8 bit, this configuration field has no meaning. this bit applies to ssirdr in receive mode and ssitdr in transmit mode. 0: parallel data (ssitdr, ssirdr) is left-aligned 1: parallel data (ssitdr, ssirdr) is right-aligned. ? dwl = 000 (with a data word length of 8 bits), the pdta setting is ignored. all data bits in ssirdr or ssitdr are used on the audio serial bus. four data words are transmitted or received at each 32-bit access. the first data word is derived from bits 7 to 0, the second from bits 15 to 8, the third from bits 23 to 16 and the last data word is derived from bits 31 to 24. ? dwl = 001 (with a data word length of 16 bits), the pdta setting is ignored. all data bits in ssirdr or ssitdr are used on the audio serial bus. two data words are transmitted or received at each 32-bit access. the first data word is derived from bits 15 to 0 and the second data word is derived from bits 31 to 16.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 593 of 1262 rej09b0437-0100 bit bit name initial value r/w description 9 pdta 0 r/w ? dwl = 010, 011, 100, 101 (with a data word length of 18, 20, 22 or 24 bits), pdta = 0 (left-aligned) the data bits used in ssi rdr or ssitdr are the following: bits 31 down to (32 minus the number of bits in the data word length specified by dwl). that is, if dwl = 011, the data word length is 20 bits; therefore, bits 31 to 12 in either ssirdr or ssitdr are used. all other bits are ignored or reserved. ? dwl = 010, 011, 100, 101 (with a data word length of 18, 20, 22 or 24 bits), pdta = 1 (right-aligned) the data bits used in ssi rdr or ssitdr are the following: bits (the number of bits in the data word length specified by dwl minus 1) to 0 i.e. if dwl = 011, then dwl = 20 and bits 19 to 0 are used in either ssirdr or ssitdr. all other bits are ignored or reserved. ? dwl = 110 (with a data word length of 32 bits), the pdta setting is ignored. all data bits in ssirdr or ssitdr are used on the audio serial bus. 8 del 0 r/w serial data delay 0: 1 clock cycle delay between ssiws and ssidata 1: no delay between ssiws and ssidata note: when cpen = 1, this bit should be set to 1. 7 ? 0 r reserved the read value is undefined. the write value should always be 0.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 594 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 to 4 ckdv[2:0] 000 r/w serial oversampling clock division ratio sets the ratio between oversampling clock * and the serial bit clock. when the sckd bit is 0, the setting of these bits is ignored. the serial bit clock is used in the shift register and is supplied from the ssisck pin. 000: serial bit clock frequency = oversampling clock frequency/1 001: serial bit clock frequency = oversampling clock frequency/2 010: serial bit clock frequency = oversampling clock frequency/4 011: serial bit clock frequency = oversampling clock frequency/8 100: serial bit clock frequency = oversampling clock frequency/16 101: serial bit clock frequency = oversampling clock frequency/6 110: serial bit clock frequency = oversampling clock frequency/12 111: setting prohibited note: * an oversampling clock is selected by the scsr_0/scsr_1 setting. 3 muen 0 r/w mute enable 0: module is not muted. 1: module is muted. 2 ? 0 r reserved t he read value is undefined. the write value should always be 0. 1 trmd 0 r/w t ransmit/receive mode select 0: module is in receive mode. 1: module is in transmit mode. 0 en 0 r/w ssi module enable 0: module is disabled. 1: module is enabled.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 595 of 1262 rej09b0437-0100 16.3.2 status register (ssisr) ssisr consists of status flags indicating the operational status of the ssi module and bits indicating the current channel numbers and word numbers. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 00000010 un- defined un- defined un- defined un- defined un- defined un- defined un- defined un- defined rrrrr/w * r/w * rrrrrrrrrr un- defined un- defined un- defined un- defined un- defined un- defined un- defined un- defined un- defined un- defined un- defined un- defined 0011 rrrrrrrrrrrrrrrr bit: initial value: r/w: bit: initial value: r/w: note: * can be read from or written to. writing 0 initializes the bit, but writing 1 is ignored. - - - dmrq uirq oirq iirq dirq - - - - - - - - - - - - - - - - - - - - chno[1:0] swno idst bit bit name initial value r/w description 31 to 29 ? all 0 r reserved the read value is not guar anteed. the write value should always be 0. 28 dmrq 0 r dma request status flag this status flag allows the cpu to recognize the value of the dma request pin on the ssi module. ? trmd = 0 (receive mode) if dmrq = 1, the ssirdr has unread data. if ssirdr is read, dmrq = 0 until there is new unread data. ? trmd = 1 (transmit mode) if dmrq = 1, ssitdr requires data to be written to continue the transmission to the audio serial bus. once data is written to ssitdr, dmrq = 0 until it requires further transmit data.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 596 of 1262 rej09b0437-0100 bit bit name initial value r/w description 27 uirq 0 r/w * underflow error interrupt status flag this status flag indicates that data was supplied at a lower rate than was required. in either case, this bit is set to 1 regardless of the value of the uien bit and can be cleared by writing 0 to this bit. if uirq = 1 and uien = 1, an interrupt occurs. ? trmd = 0 (receive mode) if uirq = 1, ssirdr was read before there was new unread data indicated by the dmrq or dirq bit. this can lead to the same received sample being stored twice by the host leading to potential corruption of multi-channel data. ? trmd = 1 (transmit mode) if uirq = 1, ssitdr did not have data written to it before it was required for transmission. this will lead to the same sample being transmitted once more and a potential corruption of multi-channel data. this is more serious error than a receive mode underflow as the output ssi data results in error. note: when underflow error occurs, the current data in the data buffer of this module is transmitted until the next data is filled.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 597 of 1262 rej09b0437-0100 bit bit name initial value r/w description 26 oirq 0 r/w * overflow error interrupt status flag this status flag indicates that data was supplied at a higher rate than was required. in either case this bit is set to 1 regardless of the value of the oien bit and can be cleared by writing 0 to this bit. if oirq = 1 and oien = 1, an interrupt occurs. ? trmd = 0 (receive mode) if oirq = 1, ssirdr was not read before there was new unread data written to it. this will lead to the loss of a sample and a potential corruption of multi-channel data. note: when overflow error occurs, the current data in the data buffer of this module is overwritten by the next incoming data from the ssi interface. ? trmd = 1 (transmit mode) if oirq = 1, ssitdr had data written to it before it was transferred to the shift register. this will lead to the loss of a sample and a potential corruption of multi-channel data. 25 iirq 1 r idle mode interrupt status flag this interrupt status flag indicates whether the ssi module is in idle state. this bit is set regardless of the value of the iien bit to allow polling. the interrupt can be masked by clearing iien, but cannot be cleared by writing to this bit. if iirq = 1 and iien = 1, an interrupt occurs. 0: the ssi module is not in idle state. 1: the ssi module is in idle state.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 598 of 1262 rej09b0437-0100 bit bit name initial value r/w description 24 dirq 0 r data interrupt status flag this status flag indicates that the module has data to be read or requires data to be written. in either case this bit is set to 1 regardless of the value of the dien bit to allow polling. the interrupt can be masked by clearing dien, but cannot be cleared by writing to this bit. if dirq= 1 and dien = 1, an interrupt occurs. ? trmd = 0 (receive mode) 0: no unread data in ssirdr 1: unread data in ssirdr ? trmd = 1 (transmit mode) 0: transmit buffer is full. 1: transmit buffer is empty and requires data to be written to ssitdr. 23 to 4 ? undefined r reserved the read value is undefined. the write value should always be 0. 3, 2 chno [1:0] 00 r channel number these bits show the current channel number. ? trmd = 0 (receive mode) chno indicates which channel the data in ssirdr currently represents. this value will change as the data in ssirdr is updated from the shift register. ? trmd = 1 (transmit mode) chno indicates which channel is required to be written to ssitdr. this value will change as the data is copied to the shift register, regardless of whether the data is written to ssitdr.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 599 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1 swno 1 r system word number this status bit indicates the current word number. ? trmd = 0 (receive mode) swno indicates which system word the data in ssirdr currently represents. this value will change as the data in ssi rdr is updated from the shift register, regardless of whether ssirdr has been read. ? trmd = 1 (transmit mode) swno indicates which system word is required to be written to ssitdr. this value will change as the data is copied to the shift register, regardless of whether the data is written to ssitdr. 0 idst 1 r idle mode status flag this status flag indicates that the serial bus activity has stopped. this bit is cleared if en = 1 and the serial bus are currently active. this bit is automatically set to 1 under the following conditions. ? ssi = master transmitter (swsd = 1 and trmd = 1) this bit is set to 1 if all the data in the system word to be transmitted has been written to ssitdr and if the en bit is cleared to end the system word currently being output. ? ssi = master receiver (swsd = 1 and trmd = 0) this bit is set to 1 if the en bit is cleared and the current system word is completed. ? ssi = slave transmitter/receiver (swsd = 0) this bit is set to 1 if the en bit is cleared and the current system word is completed. note: if the external master stops the serial bus clock before the current system word is completed, this bit is not set. note: * the bit can be read or written to. writing 0 initializes the bit, but writing 1 is ignored.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 600 of 1262 rej09b0437-0100 16.3.3 transmit data register (ssitdr) ssitdr is a 32-bit register that stores data to be transmitted. data written to this register is transferred to the sh ift register upon transmissi on request. if the data word length is less than 32 bits, the alignment is determined by the setting of the pdta control bit in ssicr. the data in the buffer ca n be accessed by reading this register. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: 16.3.4 receive data register (ssirdr) ssirdr is a 32-bit register that stores receive messages. data in this register is transferred from the sh ift register each time data word is received. if the data word length is less than 32 bits, the alignment is determined by the setting of the pdta control bit in ssicr. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr bit: initial value: r/w: bit: initial value: r/w:
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 601 of 1262 rej09b0437-0100 16.3.5 ssi clock select ion register (scsr) scsr is a 16-bit readable/writable register that selects the source of over sampling clocks used by the ssi, as well as division ratio. 1514131211109876543210 bit: initial value: r/w: note: n=0, 1 0000000000000000 rrrrrrrrrrrrrr/wr/wr/w ?? ? ? ?? ????? ? ? ssincks[2:0] bit bit name initial value r/w description 15 to 3 ? all 0 r reserved the read value is undefined. the write value should always be 0. 2 to 0 ssincks[2:0] 000 r/w ssichn clock select selects the source of the oversampling clock used by ssichn. see table 16.3. note: n = 0, 1 table 16.3 selection of the source for the oversampling clock used by ssincks clock operating mode ssincks[2:0] *1 setting 0 or 1 2 3 000 reserved. this is given as an initial value and it should be changed to an appropriate value before ssi operation. 001 reserved 010 audio_clk input *2 011 audio_clk input *2 /4 100 extal input ckio input setting prohibited 101 extal input /4 ckio input /4 setting prohibited 110 extal input /2 ckio input /2 setting prohibited 111 extal input /8 ckio input /8 setting prohibited note: *1. n = 0, 1 *2. using audio_clk requires the setting of the control register of the corresponding port.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 602 of 1262 rej09b0437-0100 16.4 operation description 16.4.1 bus format the ssi module can operate as a transmitter or a receiver and can be configured into many serial bus formats in either mode. the bus format can be selected from one of the eight major modes shown in table 18.3. table 16.4 bus format for ssi module non-compressed slave receiver non-compressed slave transmitter non-compressed master receiver non-compressed master transmitter trmd 0 1 0 1 cpen 0 0 0 0 sckd 0 0 1 1 swsd 0 0 1 1 en muen dien iien oien uien control bits del pdta sdta spdp swsp sckp swl [2:0] dwl [2:0] chnl [1:0] configuration bits
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 603 of 1262 rej09b0437-0100 16.4.2 non-compressed modes the non-compressed modes support al l serial audio streams split into channels. it supports philips, sony and matsushita modes as well as many more variants on these modes. (1) slave receiver this mode allows the module to receive serial data from another device. the clock and word select signal used for the serial data stream is also supplied from an external device. if these signals do not conform to the format specified in the configuration fields of the ssi module, operation is not guaranteed. (2) slave transmitter this mode allows the module to transmit serial data to another device. the clock and word select signal used for the serial data stream is also supp lied from an external de vice. if these signals do not conform to the format specified in the configuration fields of the ssi module, operation is not guaranteed. (3) master receiver this mode allows the module to receive serial data from another device. the clock and word select signals are internally derived from the audio_clk input clock. the format of these signals is defined in the configuration fields of the ssi module. if the incoming data does not follow the configured format, operation is not guaranteed. (4) master transmitter this mode allows the module to transmit serial data to another device. the clock and word select signals are internally derived from the audio_clk input clock. the format of these signals is defined in the configuration fields of the ssi module. (5) operating setting related to word length all bits related to the ssicr's word length are valid in non-compressed modes. there are many configurations the ssi module supports, but some of the combinations are shown below for the popular formats by philips, sony, and matsushita.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 604 of 1262 rej09b0437-0100 ? philips format figures 16.3 and 16.4 demonstrate the supported philips format both with and without padding. padding occurs when the data word length is smaller than the system word length. prev. sample msb lsb + 1 lsb msb lsb + 1 lsb next sample system word 1 = data word 1 system word 2 = data word 2 ssisck ssiws ssidata sckp = 0, swsp = 0, del = 0, chnl = 00 system word length = data word length figure 16.3 philips fo rmat (without padding) msb lsb msb lsb next system word 1 system word 2 data word 1 data word 2 padding padding ssisck ssiws ssidata sckp = 0, swsp = 0, del = 0, chnl = 00, spdp = 0, sdta = 0 system word length > data word length figure 16.4 philips format (with padding)
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 605 of 1262 rej09b0437-0100 figure 16.5 shows sony format and figure 16.6 shows matsushita format. padding is assumed in both cases, but may not be present in a final implem entation if the system word length equals the data word length. ? sony format msb lsb msb lsb next ssisck ssiws ssidata sckp = 0, swsp = 0, del = 1, chnl = 00, spdp = 0, sdta = 0 system word length > data word length system word 1 system word 2 data word 1 data word 2 padding padding figure 16.5 sony format (transmitted and received in the order of padding bits and serial data) ? matsushita format msb lsb system word 1 system word 2 data word 1 data word 2 padding padding msb lsb prev. ssisck ssiws ssidata sckp = 0, swsp = 0, del = 1, chnl = 00, spdp = 0, sdta = 1 system word length > data word length figure 16.6 matsushita format (transmitted and received in the order of serial data and padding bits)
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 606 of 1262 rej09b0437-0100 (6) multi-channel formats some devices extend the definition of the specification by philips and allow more than 2 channels to be transferred within two system words. the ssi module supports the transfer of 4, 6 and 8 channels by using the chnl, swl and dwl bits only when the system word length (swl) is greater than or equal to the data word length (dwl) multiplied by channels (chnl). table 16.5 shows the number of padding bits for each of the valid setting. if setting is not valid, ? ? ? is indicated instead of a number. table 16.5 the number of padding bits for each valid setting padding bits per system word dwl[2:0] 000 001 010 011 100 101 110 chnl [1:0] decoded channels per system word swl [2:0] decoded word length 8 16 18 20 22 24 32 000 8 0 ? ? ? ? ? ? 001 16 8 0 ? ? ? ? ? 010 24 16 8 6 4 2 0 ? 011 32 24 16 14 12 10 8 0 100 48 40 32 30 28 26 24 16 101 64 56 48 46 44 42 40 32 110 128 120 112 110 108 106 104 96 00 1 111 256 248 240 238 236 234 232 224 000 8 ? ? ? ? ? ? ? 001 16 0 ? ? ? ? ? ? 010 24 8 ? ? ? ? ? ? 011 32 16 0 ? ? ? ? ? 100 48 32 16 12 8 4 0 ? 101 64 48 32 28 24 20 16 0 110 128 112 96 92 88 84 80 64 01 2 111 256 240 224 220 216 212 208 192
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 607 of 1262 rej09b0437-0100 padding bits per system word dwl[2:0] 000 001 010 011 100 101 110 chnl [1:0] decoded channels per system word swl [2:0] decoded word length 8 16 18 20 22 24 32 000 8 ? ? ? ? ? ? ? 001 16 ? ? ? ? ? ? ? 010 24 0 ? ? ? ? ? ? 011 32 8 ? ? ? ? ? ? 100 48 24 0 ? ? ? ? ? 101 64 40 16 10 4 ? ? ? 110 128 104 80 74 68 62 56 32 10 3 111 256 232 208 202 196 190 184 160 000 8 ? ? ? ? ? ? ? 001 16 ? ? ? ? ? ? ? 010 24 ? ? ? ? ? ? ? 011 32 0 ? ? ? ? ? ? 100 48 16 ? ? ? ? ? ? 101 64 32 0 ? ? ? ? ? 110 128 96 64 56 48 40 32 0 11 4 111 256 224 192 184 176 168 160 128
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 608 of 1262 rej09b0437-0100 when the ssi module acts as a tran smitter, each word written to ssitdr is transmitted to the serial audio bus in the order they are written. wh en the ssi module acts as a receiver, each word received by the serial audio bus is read in the order received from the ssirdr register. figures 16.7 to 16.9 show how 4, 6 and 8 channels are transferred to the serial audio bus. note that there are no padding bits in the first example, the second example is left-aligned and the third is right-aligned. this selection is arbitrary and is just for demonstration purposes only. msb lsb data word 1 msb lsb msb lsb msb lsb data word 2 data word 3 data word 4 system word 1 system word 2 msb lsb data word 1 msb lsb msb lsb msb lsb data word 2 data word 3 data word 4 system word 1 system word 2 lsb msb ssisck ssiws ssidata sckp = 0, swsp = 0, del = 0, chnl = 01, spdp = don't care, sdta = don't care system word length = data word length 2 figure 16.7 multi-channel format (4 channels without padding) msb lsb system word 2 data word 1 msb lsb msb lsb msb data word 2 data word 3 padding system word 1 msb lsb msb lsb msb lsb data word 4 data word 5 data word 6 ssisck ssiws ssidata padding sckp = 0, swsp = 0, del = 0, chnl = 10, spdp = 1, sdta = 0 system word length = data word length 3 figure 16.8 multi-channel format (6 channels with high padding)
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 609 of 1262 rej09b0437-0100 msb lsb system word 2 data word 1 msb lsb msb lsb msb lsb msb lsb msb lsb msb lsb msb lsb data word 2 data word 3 data word 4 data word 5 data word 6 data word 7 data word 8 padding system word 1 padding ssiws ssidata ssisck sckp = 0, swsp = 0, del = 0, chnl = 11, spdp = 0, sdta = 1 system word length = data word length 4 figure 16.9 multi-channel format (8 channels; transm itting and receiving in the order of serial data a nd padding bits; with padding) (7) bit setting configuration format several more configuration bits in non-compressed mode are shown below. these bits are not mutually exclusive, but some combinations may not be useful for any other device. these configuration bits are described below with reference to figure 16.10. ssisck ssiws ssidata key for this and following diagrams: 0 0 0 0 0 0 means a low level on the serial bus (padding or mute) 0 means a high level on the serial bus (padding) 1 arrow head indicates sampling point of receiver bit n in ssitdr tdn 1st channel 2nd channel td28 td31 td31 td30 td29 td28 td31 td30 td29 td28 swl = 6 bits (not attainable in ssi module, demonstration only) dwl = 4 bits (not attainable in ssi module, demonstration only) chnl = 00, sckp = 0, swsp = 0, spdp = 0, sdta = 0, pdta = 0, del = 0, muen = 0 4-bit data samples continuously written to ssitdr are transmitted onto the serial audio bus. figure 16.10 basi c sample format (transmit mode with example system/data word length)
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 610 of 1262 rej09b0437-0100 figure 16.10 uses a system word length of 6 bits and a data word length of 4 bits. these settings are not possible with the ssi modul e but are used only for clarifi cation of the other configuration bits. ? inverted clock ssisck ssiws ssidata 0 0 0 0 0 0 1st channel 2nd channel td28 td31 td31 td30 td29 td28 td31 td30 td29 td28 as basic sample format configuration except sckp = 1 figure 16.11 inverted clock ? inverted word select ssisck ssiws ssidata 0 0 0 0 0 0 1st channel 2nd channel td28 td31 td31 td30 td29 td28 td31 td30 td29 td28 as basic sample format configuration except swsp = 1 figure 16.12 inverted word select ? inverted padding polarity ssisck ssiws ssidata td28 td31 1st channel 2nd channel 11 11 11 td31 td30 td29 td28 td31 td30 td29 td28 as basic sample format configuration except spdp = 1 figure 16.13 invert ed padding polarity
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 611 of 1262 rej09b0437-0100 ? transmitting and receiving in the order of serial data and padding bits; with delay ssisck ssiws ssidata 0 0 0 td28 0 0 1st channel 2nd channel td30 td29 td31 td30 td29 td28 td31 td30 td29 td28 as basic sample format configuration except sdta = 1 figure 16.14 transmitting an d receiving in the order of s erial data and padding bits; with delay ? transmitting and receiving in the order of se rial data and padding bits; without delay as basic sample format configuration except sdta = 1 and del = 1 0 0 0 td28 0 0 td29 0 td31 td30 td29 td28 td31 td30 td29 td28 ssisck ssiws ssidata 1st channel 2nd channel figure 16.15 transmitting an d receiving in the order of s erial data and padding bits; without delay ? transmitting and receiving in the order of pa dding bits and serial data; without delay as basic sample format configuration except del = 1 0 0 0 0 00 td31 td30 td31 td30 td29 td28 td31 td30 td29 td28 ssisck ssiws ssidata 1st channel 2nd channel figure 16.16 transmitting an d receiving in the order of padding bits and serial data; without delay
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 612 of 1262 rej09b0437-0100 ? parallel right-aligned with delay as basic sample format configuration except pdta = 1 0 0 0 0 00 td3 td0 td3 td2 td1 td0 td3 td2 td1 td0 ssisck ssiws ssidata 1st channel 2nd channel figure 16.17 parallel right-aligned with delay ? mute enabled as basic sample format configuration except muen = 1 (td data ignored) 0 0 0 0 00 00 00 00 0 0 0 0 0 0 ssisck ssiws ssidata 1st channel 2nd channel figure 16.18 mute enabled
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 613 of 1262 rej09b0437-0100 16.4.3 operation modes there are three modes of operation: configuration, enabled and disabled. figure 16.19 shows how the module enters each of these modes. module configuration (after reset) module enabled (normal tx/rx) en = 1 (idst = 0) module disabled (waiting until bus inactive) en = 0 (idst = 0) en = 0 (idst = 1) reset figure 16.19 operation modes (1) configuration mode this mode is entered after the module is released from reset. all required configuration fields in the control register should be defined in this mode, before the ssi module is enabled by setting the en bit. setting the en bit causes the module to enter the module enabled mode. (2) module enabled mode operation of the module in this mode is dependent on the operation mode selected. for details, refer to section 16.4.4, transm it operation and section 16.4.5 , receive operation, below.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 614 of 1262 rej09b0437-0100 16.4.4 transmit operation transmission can be controlled either by dma or interrupt. dma control is preferred to reduce the processor load. in dma control mode the processor will only receive interrupts if there is an underflow or overflow of data or the dmac has finished its transfer. the alternative method is using the interrupts that the ssi module generates to supply data as required. this mode has a higher interrupt load as the module is only double buffered and will require data to be written at least every system word period. when disabling the module, the ssi clock* must remain present until the ssi module is in idle state, indicated by the iirq bit. figure 16.20 shows the transmit operation in dma control mode, and figure 16.21 shows the transmit operation in interrupt control mode. note: * input clock from the ssisck pin when sckd = 0. input clock from the audio_clk pin when sckd = 1.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 615 of 1262 rej09b0437-0100 (1) transmission using dma controller start enable ssi module, enable dma, enable error interrupts. wait for interrupt from dmac or ssi. ssi error interrupt? more data to be send? disable ssi module, disable dma, disable error interrupts, enable idle interrupt. wait for idle interrupt from ssi module. end * ye s no no ye s ye s no en = 1, dmen = 1, uien = 1, oien = 1 en = 0, dmen = 0 uien = 0, oien = 0, iien = 1 release from reset, set ssicr configuration bits. set up dma controller to provide transmission data as required. dmac: end of tx data? note: * if the ssi encounters an error interrupt underflow/overflow, go back to the start in the flowchart again. define trmd, en, sckd, swsd, muen, del, pdta, sdta, spdp, swsp, sckp, swl, dwl, chnl figure 16.20 transmission using dma controller
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 616 of 1262 rej09b0437-0100 (2) transmission using int errupt data flow control start enable ssi module, enable data interrupts, enable error interrupts. wait for interrupt from ssi. data interrupt? more data to be send? disable ssi module, disable data interrupts disable error interrupts, enable idle interrupt. wait for idle interrupt from ssi module. end no yes yes no en = 1, dien = 1, uien = 1, oien = 1 use ssi status register bits to realign data after underflow/overflow. en = 0, dien = 0 uien = 0, oien = 0, iien = 1 load data of channel n for n = ( (chnl + 1) x 2) loop next channel release from reset, set ssicr configuration bits. define trmd, en, sckd, swsd, muen, del, pdta, sdta, spdp, swsp, sckp, swl, dwl, chnl. figure 16.21 transmission usin g interrupt data flow control
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 617 of 1262 rej09b0437-0100 16.4.5 receive operation like transmission, reception can be cont rolled either by dma or interrupt. figures 16.22 and 16.23 show the flow of operation. when disabling the ssi module, the ssi clock* must be kept supplied until the iirq bit is in idle state. note: * input clock from the ssisck pin when sckd = 0. input clock from the audio_clk pin when sckd = 1.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 618 of 1262 rej09b0437-0100 (1) reception using dma controller start enable ssi module, enable dma, enable error interrupts. wait for interrupt from dmac or ssi ssi error interrupt? more data to be send? disable ssi module, disable dma, disable error interrupts, enable idle interrupt. wait for idle interrupt from ssi module. end * yes no no yes yes no en = 1, dmen = 1, uien = 1, oien = 1 en = 0, dmen = 0 uien = 0, oien = 0, iien = 1 setup dma controller to transfer data from ssi module to memory. release from reset, define ssicr configuration bits. dmac: end of rx data? define trmd, en, sckd, swsd, muen, del, pdta, sdta, spdp, swsp, sckp, swl, dwl, chnl. note: * if the ssi encounters an error interrupt underflow/overflow, go back to the start in the flowchart again. figure 16.22 reception using dma controller
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 619 of 1262 rej09b0437-0100 (2) reception using interr upt data flow control start enable ssi module, enable data interrupts, enable error interrupts. wait for interrupt from ssi. disable ssi module, disable data interrupts, disable error interrupts, enable idle interrupt. wait for idle interrupt from ssi module. end yes no yes no en = 1, dien = 1, uien = 1, oien = 1 use ssi status register bits to realign data after underflow/overflow. en = 0, dien = 0 uien = 0, oien = 0, iien = 1 read data from receive data register. release from reset, define ssicr configuration bits. ssi error interrupt? receive more data? define trmd, en, sckd, swsd, muen, del, pdta, sdta, spdp, swsp, sckp, swl, dwl, chnl. figure 16.23 reception using interrupt data flow control
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 620 of 1262 rej09b0437-0100 when an underflow or overflow error condition has matched, the chno [1:0] bit and the swno bit can be used to recover the ssi module to a known status. when an underflow or overflow occurs, the host can read the channel number and system word number to determine what point the serial audio stream has reached. in the transmitter case, the host can skip forward through the data it wants to transmit until it finds the sample data that matches what the ssi module is expecting to transmit next, and so resynchronize with the audio data stream. in the receiver case the host cpu can store null data to make the number of receive data items consistent until it is ready to store the sample data that the ssi module is indicating will be received next , and so resynchronize with the audio data stream. 16.4.6 temporary stop and restart procedures in transmit mode the following procedures can be used for implementation. (1) procedure for the transfer and stop without having to reconfigure the bus bridge (bbg)/dmac 1. set ssicr.dmen = 0 (disabling a dm a request) to stop the dma transfer. 2. wait for ssisr.dirq = 1 (transmit mode: the transmit buffer is empty) using a polling, interrupt, or the like. 3. with ssicr.en = 0 (disabling an ssi module operation), stop the transfer. 4. before attempting another transfer, make sure that ssisr.idst = 1 is reached. 5. set ssicr.en = 1 (enabling an ssi module operation). 6. wait for ssisr.dirq = 1, using a polling, interrupt, or the like. 7. setting ssicr.dmen = 1 (enabling a dma request) will restar t the dma transfer. (2) procedure for reconfiguring the bbg/dmac aft er an ssi stop 1. set ssicr.dmen = 0 (disabling a dm a request) to stop the dma transfer. 2. wait for ssisr.dirq = 1 (transmit mode: the transmit buffer is empty), using a polling, interrupt, or the like. 3. with ssicr.en = 0 (disabling an ssi module operation), stop the transfer. 4. bring the dmac to a forced stop with the dstpr of bbg/dmac. 5. before attempting another transfer, make sure that ssisr.idst = 1 is reached. 6. set ssicr.en = 1 (enabling an ssi module operation). 7. set the bbg/dmac register s and start the transfer. 8. setting ssicr.dmen = 1 (enabling a dma request) will restar t the dma transfer.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 621 of 1262 rej09b0437-0100 16.4.7 serial bit clock control this function is used to control and select which clock is used for the serial bus interface. if the serial clock direction is set to input (sckd = 0), the ssi module is in clock slave mode and the shift register uses the bit clock that was input to the ssisck pin. if the serial clock direction is set to output (sckd = 1), the ssi module is in clock master mode, and the shift register uses the bit clock that was input from the audio_clk pin, or the bit clock that is generated by dividing them. this input clock is then divided by the ratio in the serial oversampling clock divide ratio (ckdv) in ssicr and used as the bit clock in the shift register. in either case the module pin, ssis ck, is the same as the bit clock.
section 16 serial sound interface (ssi) rev. 1.00 nov. 14, 2007 page 622 of 1262 rej09b0437-0100 16.5 usage notes 16.5.1 limitations from overfl ow during receive dma operation if an overflow occurs while the receive dma is in operation, the module s hould be restarted. the receive buffer in the ssi consists of 32-bit regi sters that share the l an d r channels. therefore, data to be received at the l channel may sometim es be received at the r channel if an overflow occurs, for example, under the following condition: the control register (ssicr) has a 32-bit setting for both data word length (dwl2 to dw l0) and system word length (swl2 to swl). if an overflow is confirmed with the overflow error interrupt or overflow error status flag (the oirq bit in ssisr), write 0 to the en bit in ssicr and dmen bit to disable dma in the ssi module, thus stopping the operation. (in this case, the controller setting should also be stopped.) after this, write 0 to the oirq bit to clear the overflow status, set dma again and restart the transfer.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 623 of 1262 rej09b0437-0100 section 17 usb 2.0 hos t/function module (usb) the usb 2.0 host/function module (usb) is a usb controller which provides capabilities as a usb host controller and usb function controller function. this module supports high-speed transfer defined by usb (universal serial bus) specification 2.0, full-speed transfer, and low-speed transfer when used as the host controller, and supports high-speed transfer and full-speed transfer when used as the function controller. this module has a usb transceiver and supports all of the transfer types defined by the usb specification. this module has an 8-kbyte buffer memory for data transfer, providing a maximum of ten pipes. any endpoint numbers can be assigned to pipe1 to pipe9, based on the peripheral devices or user system for communication. 17.1 features (1) host controller and function controller supporting usb high-speed operation ? the usb host controller and usb function controller are incorporated. ? the usb host controller and usb function controller can be switched by register settings. ? usb transceiver is incorporated. (2) reduced number of external pins and space-saving installation ? the vbus signal can be directly connect ed to the input pin of this module. ? on-chip d+ pull-up resistor (during usb function operation) ? on-chip d+ and d- pull-down resistor (during usb host operation) ? on-chip d+ and d- terminal resistor (during high-speed operation) ? on-chip d+ and d- output impedance (during full-speed operation) (3) all types of usb transfers supported ? control transfer ? bulk transfer ? interrupt transfer (high bandwidth transfers not supported) ? isochronous transfer (high bandwidth transfers not supported)
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 624 of 1262 rej09b0437-0100 (4) internal bus interfaces ? two dma interface channels are incorporated. (5) pipe configuration ? up to 8 kbytes of buffer memory for usb communications are supported ? up to ten pipes can be selected (including the default control pipe) ? programmable pipe configuration ? endpoint numbers can be assigned flexibly to pipe1 to pipe9. ? transfer conditions that can be set for each pipe: pipe0: control transfer (default control pipe: dcp), 64-byte fixed single buffer pipe1 and pipe2: bulk transfers/isochronous transfer, continuous transfer mode, programmable buffer size (up to 2-kbytes: double buffer can be specified) pipe3 to pipe5: bulk transfer, continuous transfer mode, programmable buffer size (up to 2-kbytes: double buff er can be specified) pipe6 to pipe9: interrupt transfer, 64-byte fixed single buffer (6) features of the usb host controller ? high-speed transfer (480 mbps), full-speed tran sfer (12 mbps), and lo w-speed transfer (1.5 mbps) are supported. ? communications with multiple peripheral devices connected via a single hub ? automatic response to the reset handshake ? automatic scheduling for sof and packet transmissions ? programmable intervals for isochronous and interrupt transfers
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 625 of 1262 rej09b0437-0100 (7) features of the usb function controller ? both high-speed transfer (480 mbps) and full-speed transfer (12 mbps) are supported. ? automatic recognition of high-speed operation or full-speed operation based on automatic response to the reset handshake ? control transfer stage control function ? device state control function ? auto response function for set_address request ? nak response interrupt function (nrdy) ? sof interpolation function (8) other features ? transfer ending function using transaction count ? brdy interrupt event notification timing change function (bfre) ? function that automatically clears the buffer memory after the data for the pipe specified at the dnfifo (n = 0 or 1) port has been read (dclrm) ? nak setting function for response pid generated by end of transfer (shtnak)
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 626 of 1262 rej09b0437-0100 17.2 input / output pins table 17.1 shows the pin configuration of the usb. table 17.1 usb pin configuration pin name name i/o function dp usb d+ data i/o d+ i/o of the usb on-chip transceiver dm usb d- data i/o d ? i/o of the usb on-chip transceiver this pin should be connected to the d- pin of the usb bus. vbus vbus input input usb cable connection monitor pin this pin should be connected directly to the vbus of the usb bus. whether the vbus is connected or disconnected can be detected. if this pin is not connected with the vbus of the usb bus, it should be supplied with 5 v. it should be supplied with 5 v also when the host controller function is selected. refrin reference input input reference resistor connection pin this pin should be connected to ag33 through a 5.6 k ? 1% resistor. usb_x1 input these pins should be connected to crystal oscillators for the usb. the extal_usb pin can be used for external clock input. usb_x2 crystal input output pin (clock input pin) output these pins should be connected to crystal oscillators for the usb. av33 usb analog 3.3 v power supply ? power supply for transceiver block analog pins ag33 usb analog 3.3 v ground ? ground for transceiver block analog pins dv33 usb digital 3.3 v power supply ? power supply for transceiver block digital pins dg33 usb digital 3.3 v ground ? ground for transceiver block digital pins lv15 usb core power supply ? power supply for the core lg15 usb core ground ? ground for the core
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 627 of 1262 rej09b0437-0100 pin name name i/o function av15 usb analog 1.5 v power supply ? power supply for transceiver block analog core ag15 usb analog 1.5 v ground ? ground for transceiver block analog core dv15 usb digital 1.5 v power supply ? power supply for transceiver block digital core dg15 usb digital 1.5 v ground ? ground for transceiver block digital core uv15 usb 480 mhz power supply ? power supply for 480 -mhz operation block ug15 usb 480 mhz ground ? ground for 480-mhz operation block
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 628 of 1262 rej09b0437-0100 17.3 register description table 17.2 shows the register configuration of the usb. table 17.3 shows the register state in each processing mode. table 17.2 register configuration register name abbreviation r/w address access size connection bus system configuration control register syscfg r/w h'ffff f800 16 cpu bus wait setting register buswait r/w h'ffff f802 16 system configuratio n status register syssts r h'ffff f804 16 device state control regist er dvstctr r/w h'ffff f808 16 test mode register testmode r/w h'ffff f80c 16 dma0-fifo bus configuration register d0fbcfg r/w h'ffff f810 16 dma1-fifo bus configuration register d1fbcfg r/w h'ffff f812 16 cfifo port register cfif o r/w h'ffff f814 8/16/32 cfifo port select register cfifosel r/w h'ffff f820 16 cfifo port control register cfifoctr r/w h'ffff f822 16 d0fifo port select register d0fifosel r/w h'ffff f828 16 d0fifo port control register d0fifoctr r/w h'ffff f82a 16 d1fifo port select regist er d1fifosel r/w h'ffff f82c 16 d1fifo port control register d1fifoctr r/w h'ffff f82e 16 interrupt enable register 0 intenb0 r/w h'ffff f830 16 interrupt enable register 1 intenb1 r/w h'ffff f832 16 brdy interrupt enable register brdyenb r/w h'ffff f836 16 nrdy interrupt enable register nrdyenb r/w h'ffff f838 16 bemp interrupt enable register bempenb r/w h'ffff f83a 16 sof output configur ation register sofcfg r/w h'ffff f83c 16 interrupt status register 0 intsts0 r/w h'ffff f840 16 interrupt status register 1 intsts1 r/w h'ffff f842 16 peripheral bus
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 629 of 1262 rej09b0437-0100 register name abbreviation r/w address access size connection bus brdy interrupt status regist er brdysts r/w h'ffff f846 16 nrdy interrupt status register nrdysts r/w h'ffff f848 16 bemp interrupt status regist er bempsts r/w h'ffff f84a 16 frame number register frmnum r/w h'ffff f84c 16 frame number register ufrmnum r/w h'ffff f84e 16 usb address register usbaddr r h'ffff f850 16 usb request type register usbreq r h'ffff f854 16 usb request value register usbval r h'ffff f856 16 usb request index register usbindx r h'ffff f858 16 usb request length register usbleng r h'ffff f85a 16 dcp configuration register dcpcfg r/w h'ffff f85c 16 dcp maximum packet size register dcpmaxp r/w h'ffff f85e 16 dcp control register dcpctr r/w h'ffff f860 16 pipe window select regist er pipesel r/w h'ffff f864 16 pipe configuration register pipecfg r/w h'ffff f868 16 pipe buffer setting register pipebuf r/w h'ffff f86a 16 pipe maximum packet size register pipemaxp r/w h'ffff f86c 16 pipe cycle control register pipeperi r/w h'ffff f86e 16 pipe 1 control register pipe1ctr r/w h'ffff f870 16 pipe 2 control register pipe2ctr r/w h'ffff f872 16 pipe 3 control register pipe3ctr r/w h'ffff f874 16 pipe 4 control register pipe4ctr r/w h'ffff f876 16 pipe 5 control register pipe5ctr r/w h'ffff f878 16 pipe 6 control register pipe6ctr r/w h'ffff f87a 16 pipe 7 control register pipe7ctr r/w h'ffff f87c 16 pipe 8 control register pipe8ctr r/w h'ffff f87e 16 pipe 9 control register pipe9ctr r/w h'ffff f880 16 pipe 1 transaction counter enable register pipe1tre r/w h'ffff f890 16 peripheral bus
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 630 of 1262 rej09b0437-0100 register name abbreviation r/w address access size connection bus pipe 1 transaction counter regist er pipe1trn r/w h'ffff f892 16 pipe 2 transaction counter enable register pipe2tre r/w h'ffff f894 16 pipe 2 transaction counter regist er pipe2trn r/w h'ffff f896 16 pipe 3 transaction counter enable register pipe3tre r/w h'ffff f898 16 pipe 3 transaction counter regist er pipe3trn r/w h'ffff f89a 16 pipe 4 transaction counter enable register pipe4tre r/w h'ffff f89c 16 pipe 4 transaction counter regist er pipe4trn r/w h'ffff f89e 16 pipe 5 transaction counter enable register pipe5tre r/w h'ffff f8a0 16 pipe 5 transaction counter regist er pipe5trn r/w h'ffff f8a2 16 device address 0 configuration register devadd0 r/w h'ffff f8d0 16 device address 1 configuration register devadd1 r/w h'ffff f8d2 16 device address 2 configuration register devadd2 r/w h'ffff f8d4 16 device address 3 configuration register devadd3 r/w h'ffff f8d6 16 device address 4 configuration register devadd4 r/w h'ffff f8d8 16 device address 5 configuration register devadd5 r/w h'ffff f8da 16 device address 6 configuration register devadd6 r/w h'ffff f8dc 16 device address 7 configuration register devadd7 r/w h'ffff f8de 16 device address 8 configuration register devadd8 r/w h'ffff f8e0 16 device address 9 configuration register devadd9 r/w h'ffff f8e2 16 device address a configuration register devadda r/w h'ffff f8e4 16 peripheral bus
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 631 of 1262 rej09b0437-0100 register name abbreviation r/w address access size connection bus d0fifo bus wait setting regist er d0fwait r/w h'fffc 1c0c 16 d1fifo bus wait setting regist er d1fwait r/w h'fffc 1c0e 16 d0fifo port register d0fifo r/w h'fffc 1c14 32 d1fifo port register d1fifo r/w h'fffc 1c18 32 internal bus
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 632 of 1262 rej09b0437-0100 table 17.3 register state in each processing mode register abbreviation power-on reset software standby module standby sleep syscfg initialized reta ined retained retained buswait initialized retained retained retained syssts initialized retain ed retained retained dvstctr initialized retained retained retained testmode initialized retained retained retained d0fbcfg initialized retained retained retained d1fbcfg initialized retained retained retained cfifo initialized retained retained retained d0fifo initialized retained retained retained d1fifo initialized retained retained retained cfifosel initialized retained retained retained cfifoctr initialized retained retained retained d0fifosel initialized retained retained retained d0fifoctr initialized retained retained retained d1fifosel initialized retained retained retained d1fifoctr initialized retained retained retained intenb0 initialized retained retained retained intenb1 initialized retained retained retained brdyenb initialized retained retained retained nrdyenb initialized retained retained retained bempenb initialized retained retained retained sofcfg initialized retained retained retained intsts0 initialized retained retained retained intsts1 initialized retained retained retained brdysts initialized retained retained retained nrdysts initialized retained retained retained bempsts initialized retained retained retained frmnum initialized retained retained retained ufrmnum initialized retained retained retained
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 633 of 1262 rej09b0437-0100 register abbreviation power-on reset software standby module standby sleep usbaddr initialized retained retained retained usbreq initialized retained retained retained usbval initialized retained retained retained usbindx initialized retained retained retained usbleng initialized retained retained retained dcpcfg initialized retained retained retained dcpmaxp initialized reta ined retained retained dcpctr initialized retained retained retained pipesel initialized reta ined retained retained pipecfg initialized retained retained retained pipebuf initialized reta ined retained retained pipemaxp initialized reta ined retained retained pipeperi initialized reta ined retained retained pipe1ctr initialized retained retained retained pipe2ctr initialized retained retained retained pipe3ctr initialized retained retained retained pipe4ctr initialized retained retained retained pipe5ctr initialized retained retained retained pipe6ctr initialized retained retained retained pipe7ctr initialized retained retained retained pipe8ctr initialized retained retained retained pipe9ctr initialized retained retained retained pipe1tre initialized retained retained retained pipe1trn initialized retained retained retained pipe2tre initialized retained retained retained pipe2trn initialized retained retained retained pipe3tre initialized retained retained retained pipe3trn initialized retained retained retained pipe4tre initialized retained retained retained pipe4trn initialized retained retained retained
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 634 of 1262 rej09b0437-0100 register abbreviation power-on reset software standby module standby sleep pipe5tre initialized retained retained retained pipe5trn initialized retained retained retained phytest0 initialized retained retained retained phytest1 initialized retained retained retained devadd0 initialized retained retained retained devadd1 initialized retained retained retained devadd2 initialized retained retained retained devadd3 initialized retained retained retained devadd4 initialized retained retained retained devadd5 initialized retained retained retained devadd6 initialized retained retained retained devadd7 initialized retained retained retained devadd8 initialized retained retained retained devadd9 initialized retained retained retained devadda initialized retained retained retained usbexr initialized retained retained retained
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 635 of 1262 rej09b0437-0100 17.3.1 system configuration control register (syscfg) syscfg is a register that enables high-speed operation, selects the host controller function or function controller function, controls the dp and dm pins, and enables operation of this module. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrr rrr/w r/w r/w r/w r/w r r r r/w ????? ??hse scke dcfm drpd dprpu ? ? usbe ? bit bit name initial value r/w description 15 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 10 scke 0 r/w usb module clock enable stops or enables supplying 48-mhz clock signal to this module. 0: stops supplying the clock signal to the usb module. 1: enables supplying the clock signal to the usb module. when this bit is 0, only this register and the buswait register allow both writ ing and reading; the other registers in the usb module allows reading only. 9, 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 636 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 hse 0 r/w high-speed operation enable 0: high-speed operation is disabled when the function controller function is selected: only full-speed operation is enabled. when the host controller function is selected: full- speed or low-speed operation is enabled. 1: high-speed operation is enabled (detected by this module) (1) when the host controller function is selected when hse = 0, the usb port performs low-speed or full-speed operation. set hse to 0 when connection of a low-speed peripheral device to the usb port has been detected. when hse = 1, this module executes the reset handshake protocol, and automatically allows the usb port to perform high-speed or full-speed operation according to the protocol execution result. this bit should be modified after detecting device connection (after detecting the attch interrupt) and before executing a usb bus reset (before setting usbreset to 1). (2) when the function controll er function is selected when hse = 0, this module performs full-speed operation. when hse = 1, this module executes the reset handshake protocol, and automatically performs high-speed or full-speed operation according to the protocol execution result. this bit should be modified while dprpu is 0. 6 dcfm 0 r/w controller function select selects the host controller function or function controller function. 0: function controller function is selected. 1: host controller function is selected. this bit should be modified while dprpu and dprd are 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 637 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 drpd 0 r/w d + /d ? line resistor control enables or disables pulling down d+ and d- lines when the host controller function is selected. 0: pulling down the lines is disabled. 1: pulling down the lines is enabled. this bit should be set to 1 if the host controller function is selected, and should be set to 0 if the function controller function is selected. 4 dprpu 0 r/w d + line resistor control enables or disables pulling up d+ line when the function controller function is selected. 0: pulling up the line is disabled. 1: pulling up the line is enabled. setting this bit to 1 when the function controller function is selected allows this module to pull up the d+ line to 3.3 v, thus notifying the usb host of connection. modifying this bit from 1 to 0 allows this module to cancel pulling up the d+ line, thus notifying the usb host of disconnection. this bit should be set to 1 if the function controller function is selected, and should be set to 0 if the host controller function is selected. 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 638 of 1262 rej09b0437-0100 bit bit name initial value r/w description 0 usbe 0 r/w usb module operation enable enables or disables operation of this module. 0: usb module operation is disabled. 1: usb module operation is enabled. modifying this bit from 1 to 0 initializes some register bits as listed in tables 17.4 and 17.5. this bit should be modified while scke is 1. when the host controller function is selected, this bit should be set to 1 after setting dprd to 1, eliminating lnst bit chattering, and checking that the usb bus has been settled. table 17.4 register bits in itialized by writing usbe = 0 (when function controller function is selected) register name bit name remarks syssts lnst the value is retain ed when the host controller function is selected. dvstctr rhst intsts0 dvsq the value is retained when the host controller function is selected. usbaddr usbaddr the value is retained when the host controller function is selected. usereq brequest, bmrequesttype the values are retained when the host controller function is selected. usbval wvalue the value is reta ined when the host controller function is selected. usbindx windex the value is retained when the host controller function is selected. usbleng wlength the value is retained when the host controller function is selected.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 639 of 1262 rej09b0437-0100 table 17.5 register bits init ialized by writing usbe = 0 (w hen host controller function is selected) register name bit name remarks dvstctr rhst frmnum frnm the value is retained when the function controller function is selected. ufrmnum ufrnm the value is retained when the function controller function is selected. 17.3.2 cpu bus wait setting register (buswait) buswait specifies the nu mber of access waits for those regi sters of this module that are connected to the peripheral bu s (that is, the registers exclud ing d0fwait, d1fwait, d0fifo, and d1fifo). the basic clock fo r this module is a usb clock of 48 mhz, and access from the peripheral bus is performed through p synchronization. for this reason, the usb clock must be multiplied by a certain numb er of cycles when accessing registers of this module vi a the peripheral bus. the number of access waits should be adju sted to produce at leas t the approximate value shown below: 83.4 ns (usb clock 4 cycles) when the size of access is 32 bits, 41.7 ns (usb clock 2 cycles) when the size of access is 16 bits, or 20.8 ns (usb clock 1 cycle) when the size of access is 8 bits. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 00000 00000011 r r r r r r r r r r r r r/w r/w r/w r/w 0 ?????????? ? ? 11 bwait[3:0] bit bit name initial value r/w description 15 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 640 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 to 0 bwait[3:0] 1111 r/w cpu bus wait on a p basis, set the number of waits needed when accessing registers of this module via the peripheral bus. 0000: 0 wait (accessing two cycles on a p basis) 0001: 1 wait (accessi ng three cycles on a p basis) 0010: 2 waits (accessi ng four cycles on a p basis) : 1111: 15 waits (accessing 17 cycles on a p basis) note: be sure to set this bit in the initialization routine of this module by taking into account the p and access size. 17.3.3 system configuratio n status register (syssts) syssts is a register that monitors the line status (d + and d ? lines) of the usb data bus. this register is initialized by a power-on reset or a usb bus reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 00000 00000000 rrrrrrrrrrrrrrrr 1 ?????????? ? ??? ?? lnst[1:0] bit bit name initial value r/w description 15 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 10 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 9 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 641 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1, 0 lnst[1:0] undefined * r usb data line status monitor indicates the status of the usb data bus lines (d+ and d-) as shown in table 17.6. these bits should be read after setting dprpu to 1 to notify connection when the function controller function is selected; whereas after setting drpd to 1 to enable pulling down the lines when the host controller function is selected. note: * depends on the dp and dm pin status. table 17.6 usb data bus line status lnst[1] lnst[0] during low- speed operation (only when host controller function is selected) during full- speed operation during high- speed operation during chirp operation 0 0 se0 se0 squelch squelch 0 1 k state j state not squelch chirp j 1 0 j state k state invalid chirp k 1 1 se1 se1 invalid invalid [legend] chirp: the reset handshake protocol is bei ng executed in high-speed operation enabled state (the hse bit in syscfg is set to 1). squelch: se0 or idle state not squelch: high-speed j state or high-speed k state chirp j: chirp j state chirp k: chirp k state
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 642 of 1262 rej09b0437-0100 17.3.4 device state control register (dvstctr) dvstctr is a register that controls and confirms the state of the usb data bus. this register is initialized by a power-on reset. after a usb bus reset, wkup is initialized but resume is undefined. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrrr/w * r/w r/w r/w r/w r r r r ? ? ? ? ? ? ? wkup rwupe usbrstresume uact ? rhst[2:0] bit bit name initial value r/w description 15 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 643 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 wkup 0 r/w wakeup output enables or disables outputting the remote wakeup signal (resume signal) to the usb bus when the function controller function is selected. 0: remote wakeup signal is not output. 1: remote wakeup signal is output. the module controls the output time of a remote wakeup signal. when this bit is set to 1, this module clears this bit to 0 after outputting the 10-ms k state. according to the usb specification, the usb bus idle state must be kept for 5 ms or longer before a remote wakeup signal is output. if this module writes 1 to this bit right after detection of suspended state, the k state will be output after 2 ms. note: do not write 1 to this bit, unless the device state is in the suspende d state (the dvsq bit in the intsts0 register is set to 1xx) and the usb host enables the remote wakeup signal. when this bit is set to 1, the internal clock must not be stopped even in the suspended state (write 1 to this bit while scke is 1). this bit should be set to 0 if the host controller function is selected.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 644 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 rwupe 0 r/w wakeup detection enable enables or disables the downstream port peripheral device to use the remote wakeup function (resume signal output) when the host controller function is selected. 0: downstream port wakeup is disabled. 1: downstream port wakeup is enabled. with this bit set to 1, on detecting the remote wakeup signal, this module detects the resume signal (k- state for 2.5 s) from the downstream port device and performs the resume process (drives the port to the k-state). with this bit set to 0, this module ignores the detected remote wakeup signal (k-state) from the peripheral device connected to the downstream port. while this bit is 1, the in ternal clock should not be stopped even in the suspended state (scke should be set to 1). also note that the usb bus should not be reset from the suspended state (usbrst should not be set to 1); it is prohibited by usb specification 2.0. this bit should be set to 0 if the function controller function is selected.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 645 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 usbrst 0 r/w bus reset output controls the usb bus reset signal output when the host controller function is selected. 0: usb bus reset signal is not output. 1: usb bus reset signal is output. when the host controller function is selected, setting this bit to 1 allows this module to drive the usb port to se0 to reset the usb bus. here, this module performs the reset handshake protocol if the hse bit is 1. this module continues outputting se0 while usbrst is 1 (until software sets usbrst to 0). usbrst should be 1 (= usb bus reset period) for the time defined by usb specification 2.0. writing 1 to this bit during communication (uact = 1) or during the resume process (resume = 1) prevents this module from starting the usb bus reset process until both uact and resume become 0. write 1 to the uact bit simultaneously with the end of the usb bus reset process (writing 0 to usbrst). this bit should be set to 0 if the function controller function is selected. 5 resume 0 r/w resume output controls the resume signal output when the host controller function is selected. 0: resume signal is not output. 1: resume signal is output. setting this bit to 1 allows this module to drive the port to the k-state and output the resume signal. this module continues outputting k-state while resume is 1 (until software sets resume to 0). resume should be 1 (= resume period) for the time defined by usb specification 2.0. this bit should be set to 1 in the suspended state. write 1 to the uact bit simultaneously with the end of the resume process (writing 0 to resume). this bit should be set to 0 if the function controller function is selected.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 646 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 uact 0 r/w usb bus enable enables operation of the usb bus (controls the sof or sof packet transmission to the usb bus) when the host controller function is selected. 0: downstream port is disabled (sof/ sof transmission is disabled). 1: downstream port is enabled (sof/ sof transmission is enabled). with this bit set to 1, this module puts the usb port to the usb-bus enabled state and performs sof output and data transmission and reception. this module starts outputting sof/ sof within 1 ( ) frame after software has written 1 to uact. with this bit set to 0, this module enters the idle state after outputting sof/ sof. this module sets this bit to 0 on any of the following conditions. ? a dtch interrupt is detected during communication (while uact = 1). ? an eoferr interrupt is detected during communication (while uact = 1). writing 1 to this bit should be done at the end of the usb reset process (writing 0 to usbrst) or at the end of the resume process from the suspended state (writing 0 to resume). this bit should be set to 0 if the function controller function is selected. 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 647 of 1262 rej09b0437-0100 bit bit name initial value r/w description 2 to 0 rhst[2:0] 000 r reset handshake indicates the status of the reset handshake. (1) when the host controller function is selected 000: communication speed not determined (powered state or no connection) 1xx: reset handshake in progress 001: low-speed connection 010: full-speed connection 011: high-speed connection these bits indicate 100 after software has written 1 to usbrst. if hse has been set to 1, these bits indicate 111 as soon as this module detects chirp-k from the peripheral device. this module fixes the value of the rhst bits when software writes 0 to usbrst and this module completes se0 driving. (2) when the function controller function is selected 000: communication speed not determined 100: reset handshake in progress 010: full-speed connection 011: high-speed connection if hse has been set to 1, these bits indicate 100 as soon as this module detects the usb bus reset. then, these bits indicate 011 as soon as this module outputs chirp-k and detects chirp-jk from the usb host three times. if the connection speed is not fixed to high speed within 2.5 ms after chirp-k output, these bits indicate 010. if hse has been set to 0, these bits indicate 010 as soon as this module detects the usb bus reset. a dvst interrupt is generated as soon as this module detects the usb bus reset and then the value of the rhst bits is fixed to 010 or 011. note: * only 1 can be written.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 648 of 1262 rej09b0437-0100 17.3.5 test mode register (testmode) testmode is a register that controls the usb test signal output during high-speed operation. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r r r r r r r r r r r/w r/w r/w r/w ???????????? utst[3:0] bit bit name initial value r/w description 15 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 to 0 utst[3:0] 0000 r/w test mode this module outputs the usb test signals during the high-speed operation, when these bits are written appropriate value. table 17.7 shows test mode operation of this module.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 649 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 to 0 utst[3:0] 0000 r/w (1) when the ho st controller function is selected these bits can be set after writing 1 to drpd. this module outputs waveforms to the usb port for which both dprd and uact have been set to 1. this module also performs high-speed termination for the usb port. ? procedure for setting the utst bits 1. power-on reset. 2. start the clock supply (set scke to 1 after the crystal oscillation and the pll for usb are settled). 3. set dcfm and dprd to 1 (setting hse to 1 is not required). 4. set usbe to 1. 5. set the utst bits to the appropriate value according to the test specifications. 6. set the uact bit to 1. ? procedure for modifying the utst bits 1. (in the state after executing step 6 above) set uact and usbe to 0. 2. set usbe to 1. 3. set the utst bits to the appropriate value according to the test specifications. 4. set the uact bit to 1. when these bits are set to test_se0_nak (1011), this module does not output the sof packet to the port even when 1 has been set to uact for the port. when these bits are set to test_force_enable (1101), this module outputs the sof packet to the port for which 1 has been set to uact. in this test mode, this module does not perform hardware control consequent to detection of high-speed disconnection (detection of the dtch interrupt). when setting the utst bits, the pid bits for all the pipes should be set to nak. to return to normal usb communication after a test mode has been set and executed, a power-on reset should be applied.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 650 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 to 0 utst[3:0] 0000 r/w (2) when the f unction controller function is selected the appropriate value should be set to these bits according to the setfeature request from the usb host during high-speed communication. this module does not make a transition to the suspended state while these bits are 0001 to 0100. table 17.7 test mode operation utst bit setting test mode when function controller function is selected when host controller function is selected normal operation 0000 0000 test_j 0001 1001 test_k 0010 1010 test_se0_nak 0011 1011 test_packet 0100 1100 test_force_enable ? 1101 reserved 0101 to 0111 1110 to 1111
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 651 of 1262 rej09b0437-0100 17.3.6 dma-fifo bus configuratio n registers (d0fbcfg, d1fbcfg) d0fbcfg is a register that controls dma0-fif o bus accesses. d1fbcfg is a register that controls dma1-fifo bus accesses. these registers are initiali zed by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr ?? ???????????? dfacc bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 dfacc 00 r dman-fifo buffer access mode (n = 0, 1) specifies dma0-fifo or dma1-fifo port access mode. 00: cycle steal mode (initial value) 01: 16-byte continuous access mode 10: 32-byte continuous access mode 11: invalid 11 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 652 of 1262 rej09b0437-0100 17.3.7 fifo port registers (cfifo, d0fifo, d1fifo) cfifo, d0fifo and d1fifo are port registers that are used to read data from the fifo buffer memory and writing data to the fifo buffer memory. there are three fifo ports: the cfifo, d0fifo an d d1fifo ports. each fifo port is configured of a port register (cfifo, d0fifo, d1fifo) that handles reading of data from the fifo buffer memory and writing of data to the fifo buffer memory, a select register (cfifosel, d0fifosel, d1fifosel) th at is used to select the pipe assi gned to the fifo port, and a control register (cfifoctr, d0 fifoctr, d1fifoctr). each fifo port has th e following features. ? the dcp fifo buffer should be acce ssed through the cfifo port. ? accessing the fifo buffer using dma transfer should be performed through the d0fifo or d1fifo port. ? the d1fifo and d0fifo ports can be accessed also by the cpu. ? when using functions specific to the fifo port , the pipe number (selected pipe) specified by the curpipe bits cannot be changed (when th e dma transfer function is used, etc.). ? registers configuring a fifo port do not affect other fifo ports. ? the same pipe should not be assigned to two or more fifo ports. ? there are two fifo buffer states: the access right is on the cp u side and it is on the sie side. when the fifo buffer access right is on the sie side, the fifo buffer cannot be accessed from the cpu. these registers are initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w fifoport[15:0] 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w fifoport[31:16]
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 653 of 1262 rej09b0437-0100 bit bit name initial value r/w description 31 to 0 fifoport [31:0] all 0 r/w fifo port accessing these bits allow reading the received data from the fifo buffer or writing the transmit data to the fifo buffer. these bits can be accessed only while the frdy bit in each control register (c fifoctr, d0fifoctr, or d1fifoctr) is 1. the valid bits in this register depend on the settings of the mbw bits (access bit width setting) and bigend bit (endian setting) as shown in tables 17.8 to 17.10. table 17.8 endian operation in 32-bit access (when mbw = 10) bigend bit bits 31 to 24 bits 23 to 16 bits 15 to 8 bits 7 to 0 0 n + 3 address n + 2 address n + 1 address n + 0 address 1 n + 0 address n + 1 address n + 2 address n + 3 address table 17.9 endian operation in 16-bit access (when mbw = 01) bigend bit bits 31 to 24 bits 23 to 16 bits 15 to 8 bits 7 to 0 0 writing: invalid, reading: prohibited * n + 1 address n + 0 address 1 n + 0 address n + 1 address writi ng: invalid, reading: prohibited * note: * reading data from the invalid bits in a word or byte unit is prohibited. table 17.10 endian operation in 8-bit access (when mbw = 00) bigend bit bits 31 to 24 bits 23 to 16 bits 15 to 8 bits 7 to 0 0 writing: invalid, reading: prohibited * n + 0 address 1 n + 0 address writing: invalid, reading: prohibited * note: * reading data from the invalid bits in a word or byte unit is prohibited.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 654 of 1262 rej09b0437-0100 17.3.8 fifo port select registers (cfifosel, d0fifosel, d1fifosel) cfifosel, d0fifosel and d1fifosel are registers that assign the pipe to the fifo port, and control access to the corresponding port. the same pipe should not be specified by the curpipe bits in cfifosel, d0fifosel and d1fifosel. when the curpipe bits in d0fifo sel and d1fifosel are cl eared to b'000, no pipe is selected. the pipe number should not be change d while the dma transfer is enabled. these registers are initialized by a power-on reset. (1) cfifosel 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w r r r/w r/w r r/w r r r/w r r/w r/w r/w r/w r/w * rcnt rew ? ? mbw[1:0] ? ? ? isel bigend ? curpipe[3:0] bit bit name initial value r/w description 15 rcnt 0 r/w read count mode specifies the read mode for the value in the dtln bits in cfifoctr. 0: the dtln bit is cleared when all of the receive data has been read from the cfifo. (in double buffer mode, the dtln bit value is cleared when all the data has been read from a single plane.) 1: the dtln bit is decremented when the receive data is read from the cfifo.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 655 of 1262 rej09b0437-0100 bit bit name initial value r/w description 14 rew 0 r/w * buffer pointer rewind specifies whether or not to rewind the buffer pointer. 0: the buffer pointer is not rewound. 1: the buffer pointer is rewound. when the selected pipe is in the receiving direction, setting this bit to 1 while the fifo buffer is being read allows re-reading the fifo buffer from the first data (in double buffer mode, re-reading the currently- read fifo buffer plane from the first data is allowed). do not set rew to 1 simultaneously with modifying the curpipe bits. before setting rew to 1, be sure to check that frdy is 1. to re-write to the fifo buffer again from the first data for the pipe in the tr ansmitting direction, use the bclr bit. 13, 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11, 10 mbw[1:0] 00 r/w cfifo port access bit width specifies the bit width for accessing the cfifo port. 00: 8-bit width 01: 16-bit width 10: 32-bit width 11: setting prohibited when the selected pipe is in the receiving direction, once reading data is started after setting these bits, these bits should not be modified until all the data has been read. when the selected pipe is in the receiving direction, set the curpipe and mbw bits simultaneously. when the selected pipe is in the transmitting direction, the bit width cannot be changed from the 8- bit width to the 16-/32-bit width or from the 16-bit width to the 32-bit width while data is being written to the buffer memory. the odd number of bytes can also be written through byte-access control even when 8- or 16-bit width is selected.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 656 of 1262 rej09b0437-0100 bit bit name initial value r/w description 9 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 8 bigend 0 r/w cfifo port endian control specifies the byte endian for the cfifo port. 0: little endian 1: big endian 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5 isel 0 r/w cfifo port access direction when dcp is selected 0: reading from the buffer memory is selected 1: writing to the buffer memory is selected after writing to this bit with the dcp being a selected pipe, read this bit to check that the written value agrees with the read value before proceeding to the next process. even if an attempt is made to modify the setting of this bit during access to the fifo buffer, the current access setting is retained until the access is completed. then, the modification becomes effective thus enabling continuous access. set this bit and the curpipe bits simultaneously. 4 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 657 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 to 0 curpipe[3:0] 0000 r/w cfif o port access pipe specification specifies the pipe number using which data is read or written through the cfifo port. 0000: dcp 0001: pipe 1 0010: pipe 2 0011: pipe 3 0100: pipe 4 0101: pipe 5 0110: pipe 6 0111: pipe 7 1000: pipe 8 1001: pipe 9 other than above: setting prohibited after writing to these bits, read these bits to check that the written value ag rees with the read value before proceeding to the next process. do not set the same pipe number to the curpipe bits in cfifosel, d0 fifosel, and d1fifosel. even if an attempt is made to modify the setting of these bits during access to the fifo buffer, the current access setting is retained until the access is completed. then, the modification becomes effective thus enabling continuous access. note: * only 0 can be read.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 658 of 1262 rej09b0437-0100 (2) d0fifosel, d1fifosel 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w r/w * r/w r/w r/w r/w r r/w r r r r r/w r/w r/w r/w rcnt rew dclrm dreqe mbw[1:0] big end ? ? ? curpipe[3:0] ? ? bit bit name initial value r/w description 15 rcnt 0 r/w read count mode specifies the read mode for the value in the dtln bits in dnfifoctr. 0: the dtln bit is cleared when all of the receive data has been read from the dnfifo. (in double buffer mode, the dtln bit value is cleared when all the data has been read from a single plane.) 1: the dtln bit is decremented when the receive data is read from the dnfifo. when accessing dnfifo with the bfre bit set to 1, set this bit to 0. 14 rew 0 r/w * buffer pointer rewind specifies whether or not to rewind the buffer pointer. 0: the buffer pointer is not rewound. 1: the buffer pointer is rewound. when the selected pipe is in the receiving direction, setting this bit to 1 while the fifo buffer is being read allows re-reading the fifo buffer from the first data (in double buffer mode, re-reading the currently- read fifo buffer plane from the first data is allowed). do not set rew to 1 simultaneously with modifying the curpipe bits. before setting rew to 1, be sure to check that frdy is 1. when accessing dnfifo with the bfre bit set to 1, do not set this bit to 1 in the state in which the short packet data has been read out. to re-write to the fifo buffer again from the first data for the pipe in the tr ansmitting direction, use the bclr bit.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 659 of 1262 rej09b0437-0100 bit bit name initial value r/w description 13 dclrm 0 r/w auto buffer memory clear mode accessed after specified pipe data is read enables or disables the buffer memory to be cleared automatically after data has been read out using the selected pipe. 0: auto buffer clear mode is disabled. 1: auto buffer clear mode is enabled. with this bit set to 1, this module sets bclr to 1 for the fifo buffer of the selected pipe on receiving a zero-length packet while th e fifo buffer assigned to the selected pipe is empty, or on receiving a short packet and reading the data while bfre is 1. when using this module with the brdym bit set to 1, set this bit to 0. 12 dreqe 0 r/w dma transfer request enable enables or disables the dma transfer request to be issued. 0: request disabled 1: request enabled before setting this bit to 1 to enable the dma transfer request to be issued, set the curpipe bits. before modifying the curpi pe bit setting, set this bit to 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 660 of 1262 rej09b0437-0100 bit bit name initial value r/w description 11, 10 mbw[1:0] all 0 r/w fi fo port access bit width specifies the bit width for accessing the dnfifo port. 00: 8-bit width 01: 16-bit width 10: 32-bit width 11: setting prohibited when the selected pipe is in the receiving direction, once reading data is started after setting these bits, these bits should not be modified until all the data has been read. when the selected pipe is in the receiving direction, set the curpipe and mbw bits simultaneously. when the selected pipe is in the transmitting direction, the bit width cannot be changed from the 8-bit width to the 16-/32-bit width or from the 16-bit width to the 32-bit width while data is being written to the buffer memory. the odd number of bytes can be written through byte-access control even when 8- or 16-bit width is selected. 9 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 8 bigend 0 r/w fifo port endian control specifies the byte endian for the dnfifo port. 0: little endian 1: big endian 7 to 4 ? all 0 r/w reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 661 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 to 0 curpipe[3:0] 0000 r/w fifo port access pipe specification specifies the pipe number using which data is read or written through the d0fifo/d1fifo port. 0000: no pipe specified 0001: pipe 1 0010: pipe 2 0011: pipe 3 0100: pipe 4 0101: pipe 5 0110: pipe 6 0111: pipe 7 1000: pipe 8 1001: pipe 9 other than above: setting prohibited after writing to these bits, read these bits to check that the written value ag rees with the read value before proceeding to the next process. do not set the same pipe number to the curpipe bits in cfifosel, d0 fifosel, and d1fifosel. even if an attempt is made to modify the setting of these bits during access to the fifo buffer, the current access setting is retained until the access is completed. then, the modification becomes effective thus enabling continuous access. note: * only 0 can be read. 17.3.9 fifo port control registers (cfifoctr, d0fifoctr, d1fifoctr) cfifoctr, d0fifoctr and d1fifoctr are register s that determine whether or not writing to the buffer memory has been finished, the buffer accessed from the cpu has been cleared, and the fifo port is accessible. cfifoctr, d0fifoctr, and d1 fifoctr are used for the corresponding fifo ports. these registers are initiali zed by a power-on reset.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 662 of 1262 rej09b0437-0100 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w * 2 r/w * 1 rrrrrrrrrrrrrr bval bclr frdy ? dtln[11:0] bit bit name initial value r/w description 15 bval 0 r/w * 2 buffer memory valid flag this bit should be set to 1 when data has been completely written to the fifo buffer on the cpu side for the pipe selected using the curpipe bits (selected pipe). 0: invalid 1: writing ended when the selected pipe is in the transmitting direction, set this bit to 1 in the following cases. then, this module switches the fifo buffer from the cpu side to the sie side, enabling transmission. ? to transmit a short packet, set this bit to 1 after data has been written. ? to transmit a zero-length pa cket, set this bit to 1 before data is written to the fifo buffer. ? set this bit to 1 after the number of data bytes has been written for the pipe in continuous transfer mode, where the number is a natural integer multiple of the maximum packet size and less than the buffer size. when the data of the maximum packet size has been written for the pipe in continuous transfer mode, this module sets this bit to 1 and switches the fifo buffer from the cpu side to the sie side, enabling transmission. writing 1 to this bit should be done while frdy indicates 1 (set by this module). when the selected pipe is in the receiving direction, do not set this bit to 1.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 663 of 1262 rej09b0437-0100 bit bit name initial value r/w description 14 bclr 0 r/w * 1 cpu buffer clear this bit should be set to 1 to clear the fifo buffer on the cpu side for the selected pipe. 0: invalid 1: clears the buffer memory on the cpu side. when double buffer mode is set for the fifo buffer assigned to the selected pipe, this module clears only one plane of the fifo buffer even when both planes are read-enabled. when the selected pipe is the dcp, setting bclr to 1 allows this module to clear the fifo buffer regardless of whether the fifo buffer is on the cpu side or sie side. to clear the buffer on the sie side, set the pid bits for the dcp to nak before setting bclr to 1. when the selected pipe is in the transmitting direction, if 1 is written to bval and bclr bits simultaneously, this module clears the data that has been written before it, enabling transmission of a zero-length packet. when the selected pipe is not the dcp, writing 1 to this bit should be done while frdy indicates 1 (set by this module). 13 frdy 0 r fifo port ready indicates whether the fifo port can be accessed by the cpu (dmac). 0: fifo port access is disabled. 1: fifo port access is enabled. in the following cases, this module sets frdy to 1 but data cannot be read via the fifo port because there is no data to be read. in these cases, set bclr to 1 to clear the fifo buffer, and enable transmission and reception of the next data. ? a zero-length packet is received when the fifo buffer assigned to the selected pipe is empty. ? a short packet is received and the data is completely read while bfre is 1.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 664 of 1262 rej09b0437-0100 bit bit name initial value r/w description 12 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 11 to 0 dtln[11:0] h'000 r receive data length indicates the length of the receive data. while the fifo buffer is being read, these bits indicate the different values depending on the rcnt bit value as described below. ? rcnt = 0: this module sets these bits to indicate the length of the receive data until the cpu (dmac) has read all the received data from a single fifo buffer plane. while bfre is 1, these bits retain the length of the receive data until bclr is set to 1 even after all the data has been read. ? rcnt = 1: this module decrements the value indicated by these bits each time data is read from the fifo buffer. (the value is decremented by one when mbw is 0, and by two when mbw is 1.) this module sets these bits to 0 when all the data has been read from one fifo buffer plane. however, in double buffer mode, if data has been received in one fifo buffer plane before all the data has been read from the other plane, this module sets these bits to indicate the length of the receive data in the former plane when all the data has been read from the latter plane. when rcnt is 1, reading these bits while the fifo buffer is being read returns the latest value within 150 ns after the fifo port read cycle. notes: 1. only 0 can be read and 1 can be written to. 2. only 1 can be written to.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 665 of 1262 rej09b0437-0100 17.3.10 interrupts enable register 0 (intenb0) intenb0 is a register that specifies the various interrupt masks. on detecting the interrupt corresponding to the bit in this register to whic h software has set 1, this module generates the usb interrupt. this module sets 1 to each status bit in intsts0 when a detection condition of the corresponding interrupt source has been satisfied regardless of the set value in intenb0 (regardless of whether the interrupt output is enabled or disabled). while the status bit in intsts0 corresponding to the interrupt source indicates 1, this module generates the usb interrupt when software modifies the corresponding interrupt enable bit in intenb0 from 0 to 1. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r r r r r r r r vbse rsme sofe dvse ctre bempe nrdye brdye ???????? bit bit name initial value r/w description 15 vbse 0 r/w vbus interrupts enable enables or disables the usb interrupt output when the vbint interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled 14 rsme 0 r/w resume interrupts enable enables or disables the usb interrupt output when the resm interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 666 of 1262 rej09b0437-0100 bit bit name initial value r/w description 13 sofe 0 r/w frame number update interrupts enable enables or disables the usb interrupt output when the sofr interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled 12 dvse 0 r/w device state transition interrupts enable * enables or disables the usb interrupt output when the dvst interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled 11 ctre 0 r/w control transfer stage transition interrupts enable * enables or disables the usb interrupt output when the ctrt interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled 10 bempe 0 r/w buffer empty interrupts enable enables or disables the usb interrupt output when the bemp interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled 9 nrdye 0 r/w buffer not ready response interrupts enable enables or disables the usb interrupt output when the nrdy interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 667 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 brdye 0 r/w buffer ready interrupts enable enables or disables the usb interrupt output when the brdy interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled 7 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. note: * the rsme, dvse, and ctre bits can be set to 1 only when the function controller function is selected; do not set these bits to 1 to enable the corresponding interrupt output when the host controller function is selected. 17.3.11 interrupt enable register 1 (intenb1) intenb1 is a register that specifi es the various interrupt masks when the host controller function is selected. on detecting the interrupt corresponding to the bit in this register to which software has set 1, this module generates the usb interrupt. this module sets 1 to each status bit in intsts1 when a detection condition of the corresponding interrupt source has been satisfied regardless of the set value in intenb1 (regardless of whether the interrupt output is enabled or disabled). while the status bit in intsts1 corresponding to the interrupt source indicates 1, this module generates the usb interrupt when software modifies the corresponding interrupt enable bit in intenb1 from 0 to 1. when the function controller function is selected, the interrupts should not be enabled.this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r/w r r/w r/w r r r r r/w r/w r/w r r r r ? bchge ? dtche at t che ??? eof erre signe sacke ? ? ? ? ?
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 668 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 bchge 0 r/w usb bus change interrupt enable enables or disables the usb interrupt output when the bchg interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled 13 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 12 dtche 0 r/w disconnection detection interrupt enable enables or disables the usb interrupt output when the dtch interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled 11 attche 0 r/w connection detection interrupt enable enables or disables the usb interrupt output when the attch interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled 10 to 7 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 6 eoferre 0 r/w eof error detection interrupt enable enables or disables the usb interrupt output when the eoferr interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled 5 signe 0 r/w setup transaction error interrupt enable enables or disables the usb interrupt output when the sign interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 669 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 sacke 0 r/w setup transaction normal response interrupt enable enables or disables the usb interrupt output when the sack interrupt is detected. 0: interrupt output disabled 1: interrupt output enabled 3 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. note: the intenb1 register bits can be set to 1 only when the host controller function is selected; do not set these bits to 1 to enable the corres ponding interrupt output when the function controller function is selected. 17.3.12 brdy interrupt enable register (brdyenb) brdyenb is a register that enables or disables the brdy bit in intsts0 to be set to 1 when the brdy interrupt is detected for each pipe. on detecting the brdy interrupt for the pipe corresp onding to the bit in this register to which software has set 1, this module sets 1 to the corresponding pipebrdy bit in brdysts and the brdy bit in intsts0, and generates the brdy interrupt. while at least one pipebrdy bit in brdysts indicates 1, this module generates the brdy interrupt when software modifies the corresponding interrupt enable bit in brdyenb from 0 to 1. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ?????? pipe9 brdye pipe8 brdye pipe7 brdye pipe6 brdye pipe5 brdye pipe4 brdye pipe3 brdye pipe2 brdye pipe1 brdye pipe0 brdye
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 670 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 pipe9brdye 0 r/w brdy interrupt enable for pipe9 0: interrupt output disabled 1: interrupt output enabled 8 pipe8brdye 0 r/w brdy interrupt enable for pipe8 0: interrupt output disabled 1: interrupt output enabled 7 pipe7brdye 0 r/w brdy interrupt enable for pipe7 0: interrupt output disabled 1: interrupt output enabled 6 pipe6brdye 0 r/w brdy interrupt enable for pipe6 0: interrupt output disabled 1: interrupt output enabled 5 pipe5brdye 0 r/w brdy interrupt enable for pipe5 0: interrupt output disabled 1: interrupt output enabled 4 pipe4brdye 0 r/w brdy interrupt enable for pipe4 0: interrupt output disabled 1: interrupt output enabled 3 pipe3brdye 0 r/w brdy interrupt enable for pipe3 0: interrupt output disabled 1: interrupt output enabled 2 pipe2brdye 0 r/w brdy interrupt enable for pipe2 0: interrupt output disabled 1: interrupt output enabled
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 671 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1 pipe1brdye 0 r/w brdy interrupt enable for pipe1 0: interrupt output disabled 1: interrupt output enabled 0 pipe0brdye 0 r/w brdy interrupt enable for pipe0 0: interrupt output disabled 1: interrupt output enabled 17.3.13 nrdy interrupt enable register (nrdyenb) nrdyenb is a register that enables or disables the nrdy bit in intsts0 to be set to 1 when the nrdy interrupt is detected for each pipe. on detecting the nrdy interrupt for the pipe corresponding to the bit in this register to which software has set 1, this module sets 1 to the corresponding pipenrdy bit in nrdysts and the nrdy bit in intsts0, and generates the nrdy interrupt. while at least one pipenrdy bit in nrdysts indicates 1, this module generates the nrdy interrupt when software modifies the corresponding interrupt enable bit in nrdyenb from 0 to 1. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ?????? pipe9 nrdye pipe8 nrdye pipe7 nrdye pipe6 nrdye pipe5 nrdye pipe4 nrdye pipe3 nrdye pipe2 nrdye pipe1 nrdye pipe0 nrdye
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 672 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 pipe9nrdye 0 r/w nrdy interrupt enable for pipe9 0: interrupt output disabled 1: interrupt output enabled 8 pipe8nrdye 0 r/w nrdy interrupt enable for pipe8 0: interrupt output disabled 1: interrupt output enabled 7 pipe7nrdye 0 r/w nrdy interrupt enable for pipe7 0: interrupt output disabled 1: interrupt output enabled 6 pipe6nrdye 0 r/w nrdy interrupt enable for pipe6 0: interrupt output disabled 1: interrupt output enabled 5 pipe5nrdye 0 r/w nrdy interrupt enable for pipe5 0: interrupt output disabled 1: interrupt output enabled 4 pipe4nrdye 0 r/w nrdy interrupt enable for pipe4 0: interrupt output disabled 1: interrupt output enabled 3 pipe3nrdye 0 r/w nrdy interrupt enable for pipe3 0: interrupt output disabled 1: interrupt output enabled 2 pipe2nrdye 0 r/w nrdy interrupt enable for pipe2 0: interrupt output disabled 1: interrupt output enabled
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 673 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1 pipe1nrdye 0 r/w nrdy interrupt enable for pipe1 0: interrupt output disabled 1: interrupt output enabled 0 pipe0nrdye 0 r/w nrdy interrupt enable for pipe0 0: interrupt output disabled 1: interrupt output enabled 17.3.14 bemp interrupt en able register (bempenb) bempenb is a register that enable s or disables the bemp bit in intsts0 to be set to 1 when the bemp interrupt is detected for each pipe. on detecting the bemp interrupt for the pipe corre sponding to the bit in this register to which software has set 1, this module sets 1 to the corresponding pipebemp bit in bempsts and the bemp bit in intsts0, and ge nerates the bemp interrupt. while at least one pipebemp bit in bempsts indicates 1, this module generates the bemp interrupt when software modifies the corresponding interrupt enable bit in bempenb from 0 to 1. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ?????? pipe9 bempe pipe8 bempe pipe7 bempe pipe6 bempe pipe5 bempe pipe4 bempe pipe3 bempe pipe2 bempe pipe1 bempe pipe0 bempe
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 674 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 pipe9bempe 0 r/w bemp interrupt enable for pipe9 0: interrupt output disabled 1: interrupt output enabled 8 pipe8bempe 0 r/w bemp interrupt enable for pipe8 0: interrupt output disabled 1: interrupt output enabled 7 pipe7bempe 0 r/w bemp interrupt enable for pipe7 0: interrupt output disabled 1: interrupt output enabled 6 pipe6bempe 0 r/w bemp interrupt enable for pipe6 0: interrupt output disabled 1: interrupt output enabled 5 pipe5bempe 0 r/w bemp interrupt enable for pipe5 0: interrupt output disabled 1: interrupt output enabled 4 pipe4bempe 0 r/w bemp interrupt enable for pipe4 0: interrupt output disabled 1: interrupt output enabled 3 pipe3bempe 0 r/w bemp interrupt enable for pipe3 0: interrupt output disabled 1: interrupt output enabled 2 pipe2bempe 0 r/w bemp interrupt enable for pipe2 0: interrupt output disabled 1: interrupt output enabled 1 pipe1bempe 0 r/w bemp interrupt enable for pipe1 0: interrupt output disabled 1: interrupt output enabled 0 pipe0bempe 0 r/w bemp interrupt enable for pipe0 0: interrupt output disabled 1: interrupt output enabled
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 675 of 1262 rej09b0437-0100 17.3.15 sof control register (sofcfg) sofcfg is a register that specifies the transac tion-enabled time and brdy interrupt status clear timing. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000 * 000000 r r r r r r r r/w r r/w r r rr rr ???? ? ?? ? trnen sel ?? ?? ?? brdym bit bit name initial value r/w description 15 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 trnensel 0 r/w transaction-enabled time select selects the transaction-enabled time either for full- or low-speed communication, where is the time in which this module issues tokens in a frame via the port. 0: for non-low-speed communication 1: for low-speed communication this bit is valid only when the host controller function is selected. even when the host controller function is selected, the setting of this bit has no effect on the transaction-enabled time during high-speed communication. this bit should be set to 0 when the function controller function is selected. 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 676 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 brdym 0 r/w brdy interrupt status clear timing for each pipe specifies the timing for clearing the brdy interrupt status for each pipe. 0: software clears the status. 1: this module clears the status when data has been read from the fifo buffer or data has been written to the fifo buffer. 5 ? 0 * r reserved this bit is reserved. the previously read value should be written to this bit. note: although this bit is initialized to 0 by a power- on reset, be sure to set this bit to 1 using the initialization routine of this module. 4 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. note: * although this bit is initialized to 0 by a power-on reset, be sure to set this bit to 1 using the initialization rout ine of this module.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 677 of 1262 rej09b0437-0100 17.3.16 interrupt status register 0 (intsts0) intsts0 is a register that indicates the st atus of the various interrupts detected. this register is initialized by a power-on reset. by a usb bus reset, the dvsq2 to dvsq0 bits are initialized. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 00000000 * 3 * 2 * 2 * 2 0000 r/w * 7 r/w * 7 r/w * 7 r/w * 7 r/w * 7 rrrrrrrr/w * 7 rrr vbint resm sofr dvst ctrt bemp nrdy brdy vbsts dvsq[2:0] valid ctsq[2:0] bit bit name initial value r/w description 15 vbint 0 r/w * 7 vbus interrupt status * 4 * 5 0: vbus interrupts not generated 1: vbus interrupts generated this module sets this bit to 1 on detecting a level change (high to low or low to high) in the vbus pin input value. this module sets the vbsts bit to indicate the vbus pin input value. when the vbus interrupt is generated, use software to repeat reading the vbsts bit until the same value is read three or more times, and eliminate chattering. 14 resm 0 r/w * 7 resume interrupt status * 4 * 5 * 6 0: resume interrupts not generated 1: resume interrupts generated when the function controller f unction is selected, this module sets this bit to 1 on detecting the falling edge of the signal on the dp pin in the suspended state (dvsq = 1xx). when the host controller f unction is selected, the read value is invalid.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 678 of 1262 rej09b0437-0100 bit bit name initial value r/w description 13 sofr 0 r/w * 7 frame number refresh interrupt status * 4 0: sof interrupts not generated 1: sof interrupts generated (1) when the host controller function is selected this module sets this bit to 1 on updating the frame number when software has set the uact bit to 1. (this interrupt is detected every 1 ms.) (2) when the function controller function is selected this module sets this bit to 1 on updating the frame number. (this interrupt is detected every 1 ms.) this module can detect an sofr interrupt through the internal interpolation function even when a damaged sof packet is received from the usb host. 12 dvst 0/1 * 1 r/w * 7 device state transition interrupt status * 4 * 6 0: device state transiti on interrupts not generated 1: device state transit ion interrupts generated when the function controller f unction is selected, this module updates the dvsq value and sets this bit to 1 on detecting a change in the device state. when this interrupt is generated, clear the status before this module detects the next device state transition. when the host controller f unction is selected, the read value is invalid. 11 ctrt 0 r/w * 7 control transfer stage trans ition interrupt status * 4 * 6 0: control transfer stage transition interrupts not generated 1: control transfer stage transition interrupts generated when the function controller f unction is selected, this module updates the ctsq value and sets this bit to 1 on detecting a change in the control transfer stage. when this interrupt is generated, clear the status before this module detects the next control transfer stage transition. when the host controller f unction is selected, the read value is invalid.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 679 of 1262 rej09b0437-0100 bit bit name initial value r/w description 10 bemp 0 r buffer empty interrupt status 0: bemp interrupts not generated 1: bemp interrupts generated this module sets this bit to 1 when at least one pipebemp bit in bempsts is set to 1 among the pipebemp bits corresponding to the pipebempe bits in bempenb to which 1 has been set (when this module detects the bemp interr upt status in at least one pipe among the pipes for which software enables the bemp interrupt output). for the conditions for pipebemp status assertion, refer to (3) bemp interrupts under section 17.4.2, interrupt functions. this module clears this bit to 0 when software writes 0 to all the pipebemp bi ts corresponding to the pipebempe bits to which 1 has been set. this bit cannot be cleared to 0 even if software writes 0 to this bit. 9 nrdy 0 r buffer not ready interrupt status 0: nrdy interrupts not generated 1: nrdy interrupts generated this module sets this bit to 1 when at least one pipenrdy bit in nrdysts is set to 1 among the pipenrdy bits corresponding to the pipenrdye bits in nrdyenb to which 1 has been set (when this module detects the nrdy interrupt status in at least one pipe among the pipes for which software enables the nrdy interrupt output). for the conditions for pipenrdy status assertion, refer to (2) nrdy interrupts under section 17.4.2, interrupt functions. this module clears this bit to 0 when software writes 0 to all the pipenrdy bits corresponding to the pipenrdye bits to which 1 has been set. this bit cannot be cleared to 0 even if software writes 0 to this bit.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 680 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 brdy 0 r buffer ready interrupt status indicates the brdy interrupt status. 0: brdy interrupts not generated 1: brdy interrupts generated this module sets this bit to 1 when at least one pipebrdy bit in brdysts is set to 1 among the pipebrdy bits corresponding to the pipebrdye bits in brdyenb to which 1 has been set (when this module detects the brdy interrupt status in at least one pipe among the pipes for which software enables the brdy interrupt output). for the conditions for pipebrdy status assertion, refer to (1) brdy interrupts under section 17.4.2, interrupt functions. this module clears this bit to 0 when software writes 0 to all the pipebrdy bits corresponding to the pipebrdye bits to which 1 has been set. this bit cannot be cleared to 0 even if software writes 0 to this bit. 7 vbsts 0/ 1 * 3 r vbus input status 0: the vbus pin is low level. 1: the vbus pin is high level. 6 to 4 dvsq[2:0] 000/001 * 2 r device state 000: powered state 001: default state 010: address state 011: configured state 1xx: suspended state when the host controller f unction is selected, the read value is invalid.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 681 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 valid 0 r/w * 7 usb request reception 0: not detected 1: setup packet reception when the host controller f unction is selected, the read value is invalid. 2 to 0 ctsq[2:0] 000 r control transfer stage 000: idle or setup stage 001: control read data stage 010: control read status stage 011: control write data stage 100: control write status stage 101: control write ( no data) status stage 110: control transfer sequence error 111: setting prohibited when the host controller f unction is selected, the read value is invalid. notes: 1. this bit is initialized to b'0 by a power-on reset and b'1 by a usb bus reset. 2. these bits are initialized to b'000 by a power-on reset and b'001 by a usb bus reset. 3. this bit is initialized to 0 when the leve l of the vbus pin input is high and 1 when low. 4. to clear the vbint, resm, sofr, dvst, or ctrt bit, write 0 only to the bits to be cleared; write 1 to the other bits. do not wr ite 0 to the status bits indicating 0. 5. a change in the status indicated by the vbint and resm bits can be detected even while the clock supply is stopped (while sc ke is 0), and the interrupts are output when the corresponding interrupt enable bits ar e enabled. clearing the status through software should be done after enabling the clock supply. 6. a change in the status of the resm, dvst, and ctrt bits occur only when the function controller function is selected; di sable the corresponding interrupt enable bits (set to 0) when the function controller function is selected. 7. only 0 can be written to.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 682 of 1262 rej09b0437-0100 17.3.17 interrupt status register 1 (intsts1) intsts1 is a register that is used to confirm interrupt status. interrupt generation can be confirmed simply by referencing one of the registers: intsts0 when the function controller function is selected and intsts1 when the host controller function is selected. the various interrupts indicated by the bits in this register should be enabled only when the host controller function is selected. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r/w * 1 r r/w * 1 r/w * 1 rrrrr/w * 1 r/w * 1 r/w * 1 rrrr ? bchg ? dtch attch ? ? ? ? eof err sign sack ? ? ? ? bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 bchg 0 r/w * 1 usb bus change interrupt status indicates the status of the usb bus change interrupt. 0: bchg interrupts not generated 1: bchg interrupts generated this module detects the bchg interrupt when a change in the full-speed or low-speed signal level occurs on the usb port (a change from j-state, k- state, or se0 to j-state, k- state, or se0), and sets this bit to 1. here, if software has set the corresponding interrupt enable bit to 1, this module generates the interrupt. this module sets the lnst bits in syssts0 to indicate the current input state of the usb port. when the bchg interrupt is generated, use software to repeat reading the lnst bits until the same value is read three or more times, and eliminate chattering. a change in the usb bus state can be detected even while the internal clock supply is stopped. when the function controller function is selected, the read value is invalid.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 683 of 1262 rej09b0437-0100 bit bit name initial value r/w description 13 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 12 dtch 0 r/w * 1 usb disconnection detection interrupt status indicates the status of the usb disconnection detection interrupt when the host controller function is selected. 0: dtch interrupts not generated 1: dtch interrupts generated this module detects the dtch interrupt on detecting usb bus disconnection, and sets this bit to 1. here, if software has set the corresponding interrupt enable bit to 1, this module generates the interrupt. this module detects bus disconnection based on usb specification 2.0. after detecting the dtch interrupt, this module controls hardware as described below (irrespective of the set value of the corresponding interrupt enable bit). software should terminate all the pipes in which communications are currently carried out for the usb port and make a transition to the wait state for bus connection to the usb port (wait state for attch interrupt generation). ? modifies the uact bit for the port in which a dtch interrupt has been detected to 0. ? puts the port in which a dtch interrupt has been generated into the idle state. when the function controller function is selected, the read value is invalid.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 684 of 1262 rej09b0437-0100 bit bit name initial value r/w description 11 attch 0 r/w * 1 attch interrupt status indicates the status of t he attch interrupt when the host controller function is selected. 0: attch interrupts not generated 1: attch interrupts generated this module detects the attch interrupt on detecting j-state or k-state of the full-speed or low-speed level signal for 2.5 s, and sets this bit to 1. here, if software has set the corresponding interrupt enable bit to 1, this module generates the interrupt. specifically, this module det ects the attch interrupt on any of the following conditions. ? k-state, se0, or se1 changes to j-state, and j- state continues 2.5 s. ? j-state, se0, or se1 changes to k-state, and k- state continues 2.5 s. when the function controller function is selected, the read value is invalid. 10 to 7 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 685 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 eoferr 0 r/w * 1 eof error detection interrupt status indicates the status of t he eoferr interrupt when the host controller function is selected. 0: eoferr interrupt not generated 1: eoferr interrupt generated this module detects the eoferr interrupt on detecting that communication is not completed at the eof2 timing prescribed by usb specification 2.0, and sets this bit to 1. here , if software has set the corresponding interrupt enable bit to 1, this module generates the eoferr interrupt. after detecting the eoferr interrupt, this module controls hardware as described below (irrespective of the set value of the corresponding interrupt enable bit). software should terminate all the pipes in which communications are currently carried for the usb port and perform re-enumeration of the usb port. ? modifies the uact bit for the port in which an eoferr interrupt has been detected to 0. ? puts the port in which an eoferr interrupt has been generated into the idle state. when the function controller function is selected, the read value is invalid.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 686 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 sign 0 r/w * 1 setup transaction error interrupt status indicates the status of the setup transaction error interrupt when the host controller function is selected. 0: sign interrupts not generated 1: sign interrupts generated this module detects the sign interrupt when ack response is not returned from the peripheral device three consecutive times durin g the setup transactions issued by this module, and sets this bit to 1. here, if software has set the corresponding interrupt enable bit to 1, this module generates the sign interrupt. specifically, this module detects the sign interrupt when any of the following response conditions occur for three consecutive setup transactions. ? timeout is detected when the peripheral device has returned no response. ? a damaged ack packet is received. ? a handshake other than ack (nak, nyet, or stall) is received. when the function controller function is selected, the read value is invalid. 4 sack 0 r/w * 1 setup transaction normal response interrupt status indicates the status of the setup transaction normal response interrupt when the host controller function is selected. 0: sack interrupts not generated 1: sack interrupts generated this module detects the sack interrupt when ack response is returned from the peripheral device during the setup transactions issued by this module, and sets this bit to 1. here, if software has set the corresponding interrupt enable bit to 1, this module generates the sack interrupt.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 687 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. notes: 1. to clear the status indi cated by the bits in this register, write 0 only to the bits to be cleared; write 1 to the other bits. 2. a change in the status indicated by t he bchg bit can be detected even while the clock supply is stopped (while scke is 0), and the interrupt is output when the corresponding interrupt enable bit is enabled. clearing the status through software should be done after enabling the clock supply. no interrupts other than bchg can be detected while the clock supply is stopped (while scke is 0).
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 688 of 1262 rej09b0437-0100 17.3.18 brdy interrupt status register (brdysts) brdysts is a register that indicates th e brdy interrupt status for each pipe. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrr/w * 1 r/w * 1 r/w * 1 r/w * 1 r/w * 1 r/w * 1 r/w * 1 r/w * 1 r/w * 1 r/w * 1 ?????? pipe9 brdy pipe8 brdy pipe7 brdy pipe6 brdy pipe5 brdy pipe4 brdy pipe3 brdy pipe2 brdy pipe1 brdy pipe0 brdy bit bit name initial value r/w description 15 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 pipe9brdy 0 r/w * 1 brdy interrupt status for pipe9 * 2 0: interrupts not generated 1: interrupts generated 8 pipe8brdy 0 r/w * 1 brdy interrupt status for pipe8 * 2 0: interrupts not generated 1: interrupts generated 7 pipe7brdy 0 r/w * 1 brdy interrupt status for pipe7 * 2 0: interrupts not generated 1: interrupts generated 6 pipe6brdy 0 r/w * 1 brdy interrupt status for pipe6 * 2 0: interrupts not generated 1: interrupts generated 5 pipe5brdy 0 r/w * 1 brdy interrupt status for pipe5 * 2 0: interrupts not generated 1: interrupts generated 4 pipe4brdy 0 r/w * 1 brdy interrupt status for pipe4 * 2 0: interrupts not generated 1: interrupts generated 3 pipe3brdy 0 r/w * 1 brdy interrupt status for pipe3 * 2 0: interrupts not generated 1: interrupts generated
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 689 of 1262 rej09b0437-0100 bit bit name initial value r/w description 2 pipe2brdy 0 r/w * 1 brdy interrupt status for pipe2 * 2 0: interrupts not generated 1: interrupts generated 1 pipe1brdy 0 r/w * 1 brdy interrupt status for pipe1 * 2 0: interrupts not generated 1: interrupts generated 0 pipe0brdy 0 r/w * 1 brdy interrupt status for pipe0 * 2 0: interrupts not generated 1: interrupts generated notes: 1. when brdym is 0, to clear the status indicated by the bits in this register, write 0 only to the bits to be cleared; write 1 to the other bits. 2. when brdym is 0, clearing this bit should be done before accessing the fifo. 17.3.19 nrdy interrupt status register (nrdysts) nrdysts is a register that indicates th e nrdy interrupt status for each pipe. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrr/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * ?????? pipe9 nrdy pipe8 nrdy pipe7 nrdy pipe6 nrdy pipe5 nrdy pipe4 nrdy pipe3 nrdy pipe2 nrdy pipe1 nrdy pipe0 nrdy bit bit name initial value r/w description 15 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 pipe9nrdy 0 r/w * nrdy interrupt status for pipe9 0: interrupts not generated 1: interrupts generated 8 pipe8nrdy 0 r/w * nrdy interrupt status for pipe8 0: interrupts not generated 1: interrupts generated
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 690 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 pipe7nrdy 0 r/w * nrdy interrupt status for pipe7 0: interrupts not generated 1: interrupts generated 6 pipe6nrdy 0 r/w * nrdy interrupt status for pipe6 0: interrupts not generated 1: interrupts generated 5 pipe5nrdy 0 r/w * nrdy interrupt status for pipe5 0: interrupts not generated 1: interrupts generated 4 pipe4nrdy 0 r/w * nrdy interrupt status for pipe4 0: interrupts not generated 1: interrupts generated 3 pipe3nrdy 0 r/w * nrdy interrupt status for pipe3 0: interrupts not generated 1: interrupts generated 2 pipe2nrdy 0 r/w * nrdy interrupt status for pipe2 0: interrupts not generated 1: interrupts generated 1 pipe1nrdy 0 r/w * nrdy interrupt status for pipe1 0: interrupts not generated 1: interrupts generated 0 pipe0nrdy 0 r/w * nrdy interrupt status for pipe0 0: interrupts not generated 1: interrupts generated note: * to clear the status indicated by the bits in this register, write 0 only to the bits to be cleared; write 1 to the other bits.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 691 of 1262 rej09b0437-0100 17.3.20 bemp interrupt st atus register (bempsts) bempsts is a register that indicates th e bemp interrupt status for each pipe. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrr/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * ?????? pipe9 bemp pipe8 bemp pipe7 bemp pipe6 bemp pipe5 bemp pipe4 bemp pipe3 bemp pipe2 bemp pipe1 bemp pipe0 bemp bit bit name initial value r/w description 15 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 pipe9bemp 0 r/w * bemp interrupts for pipe9 0: interrupts not generated 1: interrupts generated 8 pipe8bemp 0 r/w * bemp interrupts for pipe8 0: interrupts not generated 1: interrupts generated 7 pipe7bemp 0 r/w * bemp interrupts for pipe7 0: interrupts not generated 1: interrupts generated 6 pipe6bemp 0 r/w * bemp interrupts for pipe6 0: interrupts not generated 1: interrupts generated
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 692 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 pipe5bemp 0 r/w * bemp interrupts for pipe5 0: interrupts not generated 1: interrupts generated 4 pipe4bemp 0 r/w * bemp interrupts for pipe4 0: interrupts not generated 1: interrupts generated 3 pipe3bemp 0 r/w * bemp interrupts for pipe3 0: interrupts not generated 1: interrupts generated 2 pipe2bemp 0 r/w * bemp interrupts for pipe2 0: interrupts not generated 1: interrupts generated 1 pipe1bemp 0 r/w * bemp interrupts for pipe1 0: interrupts not generated 1: interrupts generated 0 pipe0bemp 0 r/w * bemp interrupts for pipe0 0: interrupts not generated 1: interrupts generated note: * to clear the status indicated by the bits in this register, write 0 only to the bits to be cleared; write 1 to the other bits. 17.3.21 frame number register (frmnum) frmnum is a register that determines the sour ce of isochronous error notification and indicates the frame number. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w * r/w * rrrrrrrrrrrrrr ovrn crce ? ? ? frnm[10:0]
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 693 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 ovrn 0 r/w * overrun/underrun detection status indicates whether an overrun/underrun error has been detected in the pipe during isochronous transfer. 0: no error 1: an error occurred software can clear this bit to 0 by writing 0 to the bit. here, 1 should be written to the other bits in this register. (1) when the host controller function is selected this module sets this bit to 1 on any of the following conditions. ? for the isochronous transfer pipe in the transmitting direction, the time to issue an out token comes before all the transmit data has been written to the fifo buffer. ? for the isochronous transfer pipe in the receiving direction, the time to issue an in token comes when no fifo buffer planes are empty. (2) when the function controller function is selected this module sets this bit to 1 on any of the following conditions. ? for the isochronous transfer pipe in the transmitting direction, the in token is received before all the transmit data has been written to the fifo buffer. ? for the isochronous transfer pipe in the receiving direction, the out token is received when no fifo buffer planes are empty.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 694 of 1262 rej09b0437-0100 bit bit name initial value r/w description 14 crce 0 r/w * receive data error indicates whether a crc error or bit stuffing error has been detected in the pipe during isochronous transfer. 0: no error 1: an error occurred software can clear this bit to 0 by writing 0 to the bit. here, 1 should be written to the other bits in this register. (1) when the host controller function is selected on detecting a crc error, this module generates the internal nrdy interrupt request. (2) when the function controller function is selected on detecting a crc error, this module does not generate the internal nrdy interrupt request. 13 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 10 to 0 frnm[10:0] h'000 r frame number this module sets these bits to indicate the latest frame number, which is updated every time an sof packet is issued or received (every 1 ms) repeat reading these bits until the same value is read twice. note: * only 0 can be written to
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 695 of 1262 rej09b0437-0100 17.3.22 frame number register (ufrmnum) ufrmnum is a register that indicates the frame number. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr ????????????? ufrnm[2:0] bit bit name initial value r/w description 15 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 to 0 ufrnm[2:0] 000 r frame the frame number can be confirmed. this module sets these bits to indicate the frame number during high-speed operation. during operation other than high-speed operation, this module sets these bits to b'000. repeat reading these bits until the same value is read twice.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 696 of 1262 rej09b0437-0100 17.3.23 usb address register (usbaddr) usbaddr is a register that indicates the usb ad dress. this register is valid only when the function controller function is selected. when the host controller function is selected, peripheral device addresses should be set using the devsel bits in pipemaxp. this register is initialized by a power-on reset or a usb bus reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr ????????? usbaddr[6:0] bit bit name initial value r/w description 15 to 7 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 6 to 0 usbaddr [6:0] h'00 r usb address when the function controller function is selected, these bits indicate the usb address assigned by the host when the set_address request is successfully processed. on detecting the usb reset, this module sets these bits to h'00. when the host controller f unction is selected, these bits are invalid.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 697 of 1262 rej09b0437-0100 17.3.24 usb request type register (usbreq) usbreq is a register that stores setup requests fo r control transfers. when the function controller function is selected, the values of brequest and bmrequesttype that have been received are stored. when the host controller function is selected, the values of brequest and bmrequesttype to be transmitted are set. this register is initialized by a power-on reset or a usb bus reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * brequest[7:0] bmrequesttype[7:0] bit bit name initial value r/w description 15 to 8 brequest [7:0] h'00 r/w * request these bits store the usb request brequest value. (1) when the host controller function is selected the usb request data value for the setup transaction to be transmitted should be set in these bits. do not modify these bits while sureq is 1. (2) when the function controller function is selected indicates the usb request data value received during the setup transaction. writing to these bits is invalid.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 698 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 to 0 bmrequest- type[7:0] h'00 r/w * request type these bits store the usb request bmrequesttype value. (1) when the host controller function is selected the usb request type value for the setup transaction to be transmitted should be set in these bits. do not modify these bits while sureq is 1. (2) when the function controller function is selected indicates the usb request type value received during the setup transaction. writing to these bits is invalid. note: * when the function controller function is selected, these bits can only be read, and writing to these bits is invalid. when the hos t controller function is selected, these bits can be read and written to.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 699 of 1262 rej09b0437-0100 17.3.25 usb request value register (usbval) usbval is a register that stores setup requests for control transfers. when the function controller function is selected, the value of wvalue that has been received is stored. when the host controller function is selected, the value of wvalue to be transmitted is set. this register is initialized by a power-on reset or a usb bus reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 wvalue[15:0] r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * bit bit name initial value r/w description 15 to 0 wvalue[15:0] h'0000 r/w * value these bits store the usb request wvalue value. (1) when the host controller function is selected the usb request wvalue value for the setup transaction to be transmitted should be set in these bits. do not modify these bits while sureq is 1. (2) when the function controller function is selected indicates the usb request wvalue value received during the setup transaction. writing to these bits is invalid. note: * when the function controller function is selected, these bits can only be read, and writing to these bits is invalid. when the hos t controller function is selected, these bits can be read and written to.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 700 of 1262 rej09b0437-0100 17.3.26 usb request index register (usbindx) usbindex is a register that stores setup requests for control transfers. when the function controller function is selected, the value of windex that has been r eceived is stored. when the host controller function is selected, the value of windex to be transmitted is set. this register is initialized by a power-on reset or a usb bus reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 windex[15:0] r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * bit bit name initial value r/w description 15 to 0 windex[15:0] h'0000 r/w * index these bits store the usb request windex value. (1) when the host controller function is selected the usb request windex value for the setup transaction to be transmitted should be set in these bits. do not modify these bits while sureq is 1. (2) when the function controller function is selected indicates the usb request windex value received during the setup transaction. writing to these bits is invalid. note: * when the function controller function is selected, these bits can only be read, and writing to these bits is invalid. when the hos t controller function is selected, these bits can be read and written to.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 701 of 1262 rej09b0437-0100 17.3.27 usb request leng th register (usbleng) usbleng is a register that stores setup requ ests for control transfers. when the function controller function is selected, th e value of wlength that has been received is stored. when the host controller function is selected, the value of wlength to be transmitted is set. this register is initialized by a power-on reset or a usb bus reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * wlength[15:0] bit bit name initial value r/w description 15 to 0 wlength [15:0] h'0000 r/w * length these bits store the usb request wlength value. (1) when the host controller function is selected the usb request wlength value for the setup transaction to be transmitted should be set in these bits. do not modify these bits while sureq is 1. (2) when the function controller function is selected indicates the usb request wlength value received during the setup transaction. writing to these bits is invalid. note: * when the function controller function is selected, these bits can only be read, and writing to these bits is invalid. when the hos t controller function is selected, these bits can be read and written to.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 702 of 1262 rej09b0437-0100 17.3.28 dcp configuration register (dcpcfg) dcpcfg is a register that specifies the data tran sfer direction for the default control pipe (dcp). this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrr/wrrrr ???????????dir???? bit bit name initial value r/w description 15 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 dir 0 r/w transfer direction when the host controller f unction is selected, this bit sets the transfer direction of data stage. 0: data receiving direction 1: data transmitting direction when the function controller function is selected, this bit should be cleared to 0. 3 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 703 of 1262 rej09b0437-0100 17.3.29 dcp maximum packet size register (dcpmaxp) dcpmaxp is a register that specifies the maximum packet size for the dcp. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000100000 r/w r/w r/w r/w r r r r r r/w r/w r/w r/w r r r ????? mxps[6:0] devsel[3:0] bit bit name initial value r/w description 15 to 12 devsel[3:0] 0000 r/w device select when the host controller f unction is selected, these bits specify the communication target peripheral device address. 0000: address 0000 0001: address 0001 : : 1001: address 1001 1010: address 1010 other than above: setting prohibited these bits should be set after setting the address to the devaddn register corresponding to the value to be set in these bits. for example, before setting devsel to 0010, the address should be set to the devadd2 register. these bits should be set while cssts is 0, pid is nak, and sureq is 0. before modifying these bits after modifying the pid bits for the dcp from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. when the function controller function is selected, these bits should be set to b'0000.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 704 of 1262 rej09b0437-0100 bit bit name initial value r/w description 11 to 7 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 6 to 0 mxps[6:0] h'40 r/w maximum packet size specifies the maximum data payload (maximum packet size) for the dcp. these bits are initialized to h'40 (64 bytes). these bits should be set to the value based on the usb specification. these bits should be set while cssts is 0 and pid is nak and before the pipe is selected by the curpipe bits. before modifying these bits after modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. while mxps is 0, do not write to the fifo buffer or do not set pid to buf. 17.3.30 dcp control register (dcpctr) dcpctr is a register that is used to confirm the buffer memory status, change and confirm the data pid sequence bit, and set the response pid for the dcp. this register is initialized by a power-on reset. the ccpl and pid[1:0] bits are initialized by a usb bus reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000001000000 r r/w * 1 r/w r/w * 1 r r r/w * 1 r/w * 2 r/w * 1 r r r/w r r/w * 1 r/w r/w bsts sureq csclr cscts sureq clr ? ? sqclr sqset sqmon pbusy pinge ? ccpl pid[1:0]
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 705 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 bsts 0 r buffer status indicates whether dcp fifo buffer access is enabled or disabled. 0: buffer access is disabled. 1: buffer access is enabled. the meaning of the bsts bit depends on the isel bit setting as follows. ? when isel = 0, bsts indicates whether the received data can be read from the buffer. ? when isel = 1, bsts indicates whether the data to be transmitted can be written to the buffer. 14 sureq 0 r/w * 2 setup token transmission transmits the setup packet by setting this bit to 1 when the host controller function is selected. 0: invalid 1: transmits the setup packet. after completing the setup transaction process, this module generates either the sack or sign interrupt and clears this bit to 0. this module also clears this bit to 0 when software sets the sureqclr bit to 1. before setting this bit to 1, set the devsel bits, usbreq register, usbval register, usbindx register, and usbleng register appropriately to transmit the desired usb request in the setup transaction. before setting this bit to 1, check that the pid bits for the dcp are set to nak. after setting this bit to 1, do not modify the devsel bits, usbreq register, usbval register, usbindx register, or usbleng register until the setup transaction is completed (sureq = 1). write 1 to this bit only when transmitting the setup token; for the other purposes, write 0. when the function controller function is selected, be sure to write 0 to this bit.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 706 of 1262 rej09b0437-0100 bit bit name initial value r/w description 13 csclr 0 r/w * 1 c-split status clear for split transaction when the host controller function is selected, setting this bit to 1 clears the cssts bit to 0 for the transfer using the split transaction. in this case, the next dcp transfer restarts with the s-split. 0: invalid 1: clears the cssts bit to 0. when software sets this bit to 1, this module clears the cssts bit to 0. for the transfer using the split transaction, to restart the next transfer with the s-split forcibly, set this bit to 1 through software. however, for the normal split transaction, this module automatically clears the cssts bit to 0 upon completion of the c- split; therefore, cleari ng the cssts bit through software is not necessary. controlling the cssts bit through this bit must be done while uact is 0 and thus communication is halted or while no transfer is being performed with bus disconnection detected. setting this bit to 1 while cssts is 0 has no effect. when the function controller function is selected, be sure to write 0 to this bit. 12 cssts 0 r complete split (c-split) status of split transaction indicates the c-split status of the split transaction when the host controller function is selected. 0: start-split (s-split) transaction being processed or the devic e not using the split transaction being processed 1: c-split transaction being processed this module sets this bit to 1 upon start of the c- split and clears this bit to 0 upon detection of c- split completion. when the function controller function is selected, the read value is invalid.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 707 of 1262 rej09b0437-0100 bit bit name initial value r/w description 11 sureqclr 0 r/w * 1 sureq bit clear when the host controller function is selected, setting this bit to 1 clears the sureq bit to 0. 0: invalid 1: clears the sureq bit to 0. this bit always indicates 0. set this bit to 1 through software when communication has stopped with sureq being 1 during the setup transaction. however, for normal setup transactions, this module automatically clears the sureq bit to 0 upon completion of the transaction; therefore, clearing the sureq bit through software is not necessary. controlling the sureq bit through this bit must be done while uact is 0 and thus communication is halted or while no transfer is being performed with bus disconnection detected. when the function controller function is selected, be sure to write 0 to this bit. 10, 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 708 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 sqclr 0 r/w * 1 toggle bit clear specifies data0 as the expected value of the sequence toggle bit for the next transaction during the dcp transfer. 0: invalid 1: specifies data0. this bit always indicates 0. do not set the sqclr and sqset bits to 1 simultaneously. set this bit to 1 while cscts is 0, pid is nak, and curpipe bits are not yet set. before setting this bit to 1 after modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. 7 sqset 0 r/w * 1 toggle bit set specifies data1 as the expected value of the sequence toggle bit for the next transaction during the dcp transfer. 0: invalid 1: specifies data1. do not set the sqclr and sqset bits to 1 simultaneously. set this bit to 1 while cscts is 0, pid is nak, and curpipe bits are not yet set. before setting this bit to 1 after modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 709 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 sqmon 1 r sequence toggle bit monitor indicates the expected value of the sequence toggle bit for the next transaction during the dcp transfer. 0: data0 1: data1 this module allows this bit to toggle upon normal completion of the transaction. however, this bit is not allowed to toggle when a data-pid disagreement occurs during the transfer in the receiving direction. when the function controller function is selected, this module sets this bit to 1 (specifies data1 as the expected value) upon normal reception of the setup packet. when the function controller function is selected, this module does not reference to this bit during the in/out transaction of the status stage, and does not allow this bit to toggle upon normal completion. 5 pbusy 0 r pipe busy this bit indicates whether dcp is used or not for the transaction when usb changes the pid bits from buf to nak. 0: dcp is not used for the transaction. 1: dcp is used for the transaction. this module modifies this bit from 0 to 1 upon start of the usb transaction for the pertinent pipe, and modifies the bit from 1 to 0 upon completion of one transaction. reading this bit after software has set pid to nak allows checking that modification of the pipe settings is possible. for details, refer to (1) pipe control register switching procedures under section 17.4.3, pipe control.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 710 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 pinge 0 r/w ping token issue enable when the host controller function is selected, setting this bit to 1 allows this module to issue the ping token during transfers in the transmitting direction and start a transfer in the transmitting direction with the ping transaction. 0: disables issuing ping token. 1: enables normal ping operation. when having detected the ack handshake during ping transactions, this module performs the out transaction as the next transaction. when having detected the nak handshake during out transactions, this module performs the ping transaction as the next transaction. when the host controller function is selected, setting this bit to 0 through software prevents this module from issuing the ping token during transfers in the transmitting direction and only allows this module to perform out transactions for the transfers in the transmitting direction. these bits should be modified while cssts is 0 and pid is nak. before setting this bit to 1 after modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. when the function controller function is selected, be sure to write 0 to this bit. 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 711 of 1262 rej09b0437-0100 bit bit name initial value r/w description 2 ccpl 0 r/w * 1 control transfer end enable when the function controller function is selected, setting this bit to 1 enables the status stage of the control transfer to be completed. 0: invalid 1: completion of control transfer is enabled. when software sets this bit to 1 while the corresponding pid bits are set to buf, this module completes the control transfer stage. specifically, during control read transfer, this module transmits the ack handshake in response to the out transaction from the usb host, and outputs the zero-length packet in response to the in transaction from the usb host during control write or no-data control transfer. however, on detecting the set_address request, this module operates in auto response mode from the setup stage up to the status stage completi on irrespective of the setting of this bit. this module modifies this bit from 1 to 0 on receiving the new setup packet. software cannot write 1 to this bit while valid is 1. when the host controller function is selected, be sure to write 0 to this bit.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 712 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1,0 pid[1:0] 00 r/w response pid controls the response type of this module during control transfer. 00: nak response 01: buf response (depending on the buffer state) 10: stall response 11: stall response (1) when the host controller function is selected modify the setting of these bits from nak to buf using the following procedure. ? when the transmitting direction is set write all the transmit data to the fifo buffer while uact is 1 and pid is nak, and then set pid to buf. after pid has been set to buf, this module executes the out transaction (or ping transaction). ? when the receiving direction is set check that the fifo buffer is empty (or empty the buffer) while uact is 1 and pid is nak, and then set pid to buf. after pid has been set to buf, this module executes the in transaction. this module modifies the setting of these bits as follows. ? this module sets pid to stall (11) on receiving the data of the size exceeding the maximum packet size when software has set pid to buf. ? this module sets pid to nak on detecting a receive error such as a crc error three consecutive times. ? this module also sets pid to stall (11) on receiving the stall handshake.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 713 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1,0 pid[1:0] 00 r/w even if software modifies the pid bits to nak after this module has issued s-split of the split transaction for the selected pipe (while cssts indicates 1), this module continues the transaction until c-split completes. on completion of c- split, this module sets pid to nak. (2) when the function controller function is selected this module modifies the setting of these bits as follows. ? this module modifies pid to nak on receiving the setup packet. here, this module sets valid to 1. software cannot modify the setting of pid until software sets valid to 0. ? this module sets pid to stall (11) on receiving the data of the size exceeding the maximum packet size when software has set pid to buf. ? this module sets pid to stall (1x) on detecting the control transfer sequence error. ? this module sets pid to nak on detecting the usb bus reset. this module does not reference to the setting of the pid bits while the set_address request is processed (auto processing). notes: 1. this bit is always read as 0. only 1 can be written to. 2. only 1 can be written to.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 714 of 1262 rej09b0437-0100 17.3.31 pipe window select register (pipesel) pipe1 to pipe 9 should be set using pipesel, pipecfg, pipebuf, pipemaxp, pipeperi, pipenctr, pipentre, and pipentrn. after selecting the pipe using pipesel, functions of the pipe should be set using pipecfg, pipe buf, pipemaxp, and pipeperi. pipenctr, pipentre, and pipentrn can be set regardless of the pipe selection in pipesel. for a power-on reset and a usb bus reset, the corresponding bits for not only the selected pipe but all of the pipes are initialized. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r r r r r r r r r r r/w r/w r/w r/w ???????????? pi pesel[3:0] bit bit name initial value r/w description 15 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 715 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 to 0 pipesel[3:0] 0000 r/w pipe window select selects the pipe number corresponding to the pipecfg, pipebuf, pipemaxp, and pipeperi registers which data is written to or read from. 0000: no pipe selected 0001: pipe1 0010: pipe2 0011: pipe3 0100: pipe4 0101: pipe5 0110: pipe6 0111: pipe7 1000: pipe8 1001: pipe9 other than above: setting prohibited selecting a pipe number through these bits allows writing to and reading from the pipecfg, pipebuf, pipemaxp, and pipeperi registers that correspond to the selected pipe number. when pipesel = 0000, 0 is read from all of the bits in pipecfg, pipebuf, pipemaxp, pipeeri and pipenctr. writing to these bits is invalid.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 716 of 1262 rej09b0437-0100 17.3.32 pipe configuration register (pipecfg) pipecfg is a register that specifies the tran sfer type, buffer memory access direction, and endpoint numbers for pipe1 to pipe9. it also selects continuous or non-continuous transfer mode, single or double buffer mode, and whether to continue or disable pipe operation at the end of transfer. this register is initialized by a power-on reset. only the type[1:0] bits are initialized by a usb bus reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w r/w r r r r/w r/w r/w r/w r r r/w r/w r/w r/w r/w type[1:0] ? ? ? bfre dblb cntmd sht nak ? ? dir epnum[3:0]
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 717 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15, 14 type[1:0] 00 r/w transfer type selects the transfer type fo r the pipe selected by the pipesel bits (selected pipe) ? pipe1 and pipe2 00: pipe not used 01: bulk transfer 10: setting prohibited 11: isochronous transfer ? pipe3 to pipe5 00: pipe not used 01: bulk transfer 10: setting prohibited 11: setting prohibited ? pipe6 and pipe7 00: pipe not used 01: setting prohibited 10: interrupt transfer 11: setting prohibited before setting pid to bu f for the selected pipe (before starting usb communication using the selected pipe), be sure to set these bits to the value other than 00. modify these bits while the pid bits for the selected pipe are set to nak. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 718 of 1262 rej09b0437-0100 bit bit name initial value r/w description 13 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 10 bfre 0 r/w brdy interrupt operation specification specifies the brdy interrupt generation timing from this module to the cpu with respect to the selected pipe. 0: brdy interrupt upon transmitting or receiving of data 1: brdy interrupt upon completion of reading of data when software has set this bit to 1 and the selected pipe is in the receiving direction, this module detects the transfer completion and generates the brdy interrupt on having read the pertinent packet. when the brdy interrupt is generated with the above conditions, software needs to write 1 to bclr. the fifo buffer assigned to the selected pipe is not enabled for reception until 1 is written to bclr. when software has set this bit to 1 and the selected pipe is in the transmitting direction, this module does not generate the brdy interrupt. for details, refer to (1) b rdy interrupt under section 17.4.2, interrupt functions. modify these bits while cssts is 0 and pid is nak and before the pipe is selected by the curpipe bits. to modify these bits after completing usb communication using the selected pipe, write 1 and then 0 to aclrm continuously through software to clear the fifo buffer assigned to the selected pipe while the cssts, pid, and curpipe bits are in the above-described state. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 719 of 1262 rej09b0437-0100 bit bit name initial value r/w description 9 dblb 0 r/w double buffer mode selects either single or double buffer mode for the fifo buffer used by the selected pipe. 0: single buffer 1: double buffer this bit is valid when pipe1 to pipe5 are selected. when software has set this bit to 1, this module assigns two planes of the fifo buffer size specified by the bufsize bits in pipebuf to the selected pipe. specifically, the following expression determines the fifo buffer size assigned to the selected pipe by this module. (bufsize + 1) * 64 * (dblb + 1) [bytes] when software has set this bit to 1 and the selected pipe is in the transmitting direction, this module does not generate the brdy interrupt. for details, refer to (1) b rdy interrupt under section 17.4.2, interrupt functions. modify these bits while cssts is 0 and pid is nak and before the pipe is selected by the curpipe bits. to modify these bits after completing usb communication using the selected pipe, write 1 and then 0 to aclrm continuously through software to clear the fifo buffer assigned to the selected pipe while the cssts, pid, and curpipe bits are in the above-described state. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 720 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 cntmd 0 r/w continuous transfer mode specifies whether to use the selected pipe in continuous transfer mode. 0: non-continuous transfer mode 1: continuous transfer mode this bit is valid when pipe1 to pipe5 are selected by the pipesel bits and bulk transfer is selected (type = 01). modify these bits while cssts is 0 and pid is nak and before the pipe is selected by the curpipe bits. to modify these bits after completing usb communication using the selected pipe, write 1 and then 0 to aclrm continuously through software to clear the fifo buffer assigned to the selected pipe while the cssts, pid, and curpipe bits are in the above-described state. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 721 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 shtnak 0 r/w pipe disabled at end of transfer specifies whether to modify pid to nak upon the end of transfer when the selected pipe is in the receiving direction. 0: pipe continued at the end of transfer 1: pipe disabled at the end of transfer this bit is valid when the selected pipe is pipe1 to pipe5 in the receiving direction. when software has set this bit to 1 for the selected pipe in the receiving direction, this module modifies the pid bits corresponding to the selected pipe to nak on determining the end of the transfer. this module determines that the transfer has ended on any of the following conditions. ? a short packet (including a zero-length packet) is successfully received. ? the transaction counter is used and the number of packets specified by the counter are successfully received. modify these bits while cssts is 0 and pid is nak. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. this bit should be cleared to 0 for the pipe in the transmitting direction. 6, 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 722 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 dir 0 r/w transfer direction specifies the transfer direction for the selected pipe. 0: receiving direction 1: sending direction when software has set this bit to 0, this module uses the selected pipe in the receiving direction, and when software has set this bit to 1, this module uses the selected pipe in the transmitting direction. modify these bits while cssts is 0 and pid is nak and before the pipe is selected by the curpipe bits. to modify these bits after completing usb communication using the selected pipe, write 1 and then 0 to aclrm continuously through software to clear the fifo buffer assigned to the selected pipe while the cssts, pid, and curpipe bits are in the above-described state. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. 3 to 0 epnum[3:0] 0000 r/w endpoint number these bits specify the endpoint number for the selected pipe. setting 0000 means unused pipe. modify these bits while cssts is 0 and pid is nak. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. do not make the settings such that the combination of the set values in the dir and epnum bits should be the same for two or more pipes (epnum = 0000 can be set for all the pipes).
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 723 of 1262 rej09b0437-0100 17.3.33 pipe buffer setting register (pipebuf) pipebuf is a register that specifies the buff er size and buffer number for pipe1 to pipe9. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r/w r/w r/w r/w r/w r r r/w r/w r/w r/w r/w r/w r/w r/w ? bufsize[4:0] ? ? bufnmb[7:0] bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 724 of 1262 rej09b0437-0100 bit bit name initial value r/w description 14 to 10 bufsize[4:0] h'00 r/w buffer size specifies the size of the buffer for the pipe selected by the pipesel bits (selected pipe) in terms of blocks, where one block comprises 64 bytes. 00000 (h'00): 64 bytes 00001 (h'01): 128 bytes : : 11111 (h'1f): 2 kbytes when software has set the dblb bit to 1, this module assigns two planes of the fifo buffer size specified by the bufsize bits to the selected pipe. specifically, the following expression determines the fifo buffer size assigned to the selected pipe by this module. (bufsize + 1) * 64 * (dblb + 1) [bytes] the valid value for these bits depends on the selected pipe. ? pipe1 to pipe5: any value from h'00 to h'1f is valid. ? pipe6 to pipe9: h'00 should be set. when used with cntmd = 1, set an integer multiple of the maximum packet size to the bufsize bits. modify these bits while cssts is 0 and pid is nak and before the pipe is selected by the curpipe bits. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. 9, 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 725 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 to 0 bufnmb[7:0] h'00 r/w buffer number these bits specify the fifo buffer number for the selected pipe (from h'04 to h'7f). when the selected pipe is one of pipe1 to pipe5, any value can be set to these bits according to the user system. bufnumb = h'00 to h'03 are used exclusively for dcp. bufnmb = h'04 is used exclusively for pipe6. when pipe6 is not used, h'04 can be used for other pipes. when pipe6 is selected, writing to these bits is invalid and h'04 is automatically assigned by this module. bufnmb = h'05 is used exclusively for pipe7. when pipe7 is not used, h'05 can be used for other pipes. when pipe7 is selected, writing to these bits is invalid and h'05 is automatically assigned by this module. bufnumb = h'06 is used exclusively for pipe8. when pipe8 is not used, h'06 can be used for other pipes. when pipe8 is selected, writing to these bits is invalid and h'06 is automatically assigned by this module. bufnumb = h'07 is used exclusively for pipe9. when pipe9 is not used, h'07 can be used for other pipes. when pipe9 is selected, writing to these bits is invalid and h'07 is automatically assigned by this module. modify these bits while cssts is 0 and pid is nak and before the pipe is selected by the curpipe bits. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 726 of 1262 rej09b0437-0100 17.3.34 pipe maximum packet size register (pipemaxp) pipemaxp is a register that specifies th e maximum packet size for pipe1 to pipe9. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ? mxps[10:0] devsel[3:0] bit bit name initial value r/w description 15 to 12 devsel[3:0] 00 r/w device select when the host controller f unction is selected, these bits specify the usb address of the communication target peripheral device. 0000: address 0000 0001: address 0001 0010: address 0010 : : 1010: address 1010 other than above: setting prohibited these bits should be set after setting the address to the devaddn register corresponding to the value to be set in these bits. for example, before setting devsel to 0010, the address should be set to the devadd2 register. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. when the function controller function is selected, these bits should be set to b'0000. 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 727 of 1262 rej09b0437-0100 bit bit name initial value r/w description 10 to 0 mxps[10:0] * r/w maximum packet size specifies the maximum data payload (maximum packet size) for the selected pipe. the valid value for these bits depends on the pipe as follows. pipe1, pipe2: 1 byte (h'001) to 1,024 bytes (h'400) pipe3 to pipe5: 8 bytes (h'008), 16 bytes (h'010), 32 bytes (h'020), 64 bytes (h'040), and 512 bytes (h'200) (bits 2 to 0 are not provided.) pipe6 to pipe9: 1 byte (h'001) to 64 bytes (h'040) these bits should be set to the appropriate value for each transfer type based on the usb specification. for split transactions using the isochronous pipe, these bits should be set to 188 bytes or less. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. while mxps is 0, do not write to the fifo buffer or set pid to buf. note: * the initial value of mxps is h'000 when no pipe is selected with the pipesel bits in pipesel and h'040 when a pipe is select ed with the pipesel bit in pipesel.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 728 of 1262 rej09b0437-0100 17.3.35 pipe timing control register (pipeperi) pipeperi is a register that selects whether the bu ffer is flushed or not when an interval error occurred during isochronous in transfer, and sets th e interval error detection interval for pipe1 to pipe9. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r r/w r r r r r r r r r r/w r/w r/w ???ifis????????? iitv[2:0] bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 ifis 0 r/w isochronous in buffer flush specifies whether to flush the buffer when the pipe selected by the pipesel bits (selected pipe) is used for isochronous in transfers. 0: the buffer is not flushed. 1: the buffer is flushed. when the function controller function is selected and the selected pipe is for isochronous in transfers, this module automatically clears the fifo buffer when this module fails to rece ive the in token from the usb host within the interval set by the iitv bits in terms of ( ) frames. in double buffer mode (dblb = 1), this module only clears the data in the plane used earlier. this module clears the fifo buffer on receiving the sof packet immediately after the ( ) frame in which this module has expected to receive the in token. even if the sof packet is corrupted, this module also clears the fifo buffer at the right timing to receive the sof packet by using the internal interpolation. when the host controller function is selected, set this bit to 0. when the selected pipe is not for the isochronous transfer, set this bit to 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 729 of 1262 rej09b0437-0100 bit bit name initial value r/w description 11 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 to 0 iitv[2:0] 000 r/w interval error detection interval specifies the interval error detection timing for the selected pipe in terms of frames, which is expressed as n-th power of 2 (n is the value to be set). as described later, the detailed functions are different in host controller mode and in function controller mode. modify these bits while cssts is 0 and pid is nak and before the pipe is selected by the curpipe bits. before modifying these bits after modifying the pid bits for the selected pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. before modifying these bits after usb communication has been completed with these bits set to a certain value, se t pid to nak and then set aclrm to 1 to initialize the interval timer. the iitv bits are invalid for pipe3 to pipe5; set these bits to 000 for these pipes.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 730 of 1262 rej09b0437-0100 17.3.36 pipen control registers (pipenctr) (n = 1 to 9) pipenctr is a register that is used to confirm the buffer memory status for the corresponding pipe, change and confirm the data pid sequence bit, determine whether auto response mode is set, determine whether auto buffer clear mode is set, and set a response pid for pipe1 to pipe9. this register can be set regardless of the pipe selection in pipesel. this register is initialized by a power-on reset. pid[1:0] are initialized by a usb bus reset. (1) pipenctr (n = 1 to 5) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r/w * 2 r r r/w r/w r/w * 1 r/w * 1 r r r r r r/w r/w bsts inbufm csclr cssts ? at repm aclrm sqclr sqset sqmon pbusy ? ? ? pid[1:0] bit bit name initial value r/w description 15 bsts 0 r buffer status indicates the fifo buffer status for the pertinent pipe. 0: buffer access is disabled. 1: buffer access is enabled. the meaning of this bit depends on the settings of the dir, bfre, and dclrm bits as shown in table 17.11.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 731 of 1262 rej09b0437-0100 bit bit name initial value r/w description 14 inbufm 0 r in buffer monitor indicates the pertinent fifo buffer status when the pertinent pipe is in the transmitting direction. 0: there is no data to be transmitted in the buffer memory. 1: there is data to be transmitted in the buffer memory. when the pertinent pipe is in the transmitting direction (dir = 1), this module sets this bit to 1 when software (or dmac) completes writing data to at least one fifo buffer plane. this module sets this bit to 0 when this module completes transmitting the data from the fifo buffer plane to which all the data has been written. in double buffer mode (dblb = 1), this module sets this bit to 0 when this module completes transmitting the data from the two fifo bu ffer planes before software (or dmac) completes writing data to one fifo buffer plane. this bits indicates the same value as the bsts bit when the pertinent pipe is in the receiving direction (dir = 0).
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 732 of 1262 rej09b0437-0100 bit bit name initial value r/w description 13 csclr 0 r/w * 2 c-split status clear bit when the host controller function is selected, setting this bit to 1 through software allows this module to clear the cssts bit to 0. 0: writing invalid 1: clears the cssts bit to 0. for the transfer using the split transaction, to restart the next transfer with the s-split forcibly, set this bit to 1 through software. however, for the normal split transaction, this module automatically clears the cssts bit to 0 upon completion of the c-split; therefore, clearing the csst s bit through software is not necessary. controlling the cssts bit through this bit must be done while uact is 0 and thus communication is halted or while no transfer is being performed with bus disconnection detected. setting this bit to 1 while cssts is 0 has no effect. when the function controller function is selected, be sure to write 0 to this bit. 12 cssts 0 r cssts status bit indicates the c-split status of the split transaction when the host controller function is selected. 0: start-split (s-split) transaction being processed or the transfer not using the split transaction in progress 1: c-split transaction being processed this module sets this bit to 1 upon start of the c- split and clears this bit to 0 upon detection of c- split completion. indicates the valid value only when the host controller function is selected. 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 733 of 1262 rej09b0437-0100 bit bit name initial value r/w description 10 atrepm 0 r/w auto response mode enables or disables auto response mode for the pertinent pipe. 0: auto response disabled 1: auto response enabled when the function controller function is selected and the pertinent pipe is for bulk transfer, this bit can be set to 1. when this bit is set to 1, this module responds to the token from the usb host as described below. (1) when the pertinent pipe is for bulk in transfer (type = 01 and dir = 1) when atrepm = 1 and pid = buf, this module transmits a zero-length packet in response to the in token. this module updates (allows toggling of) the sequence toggle bit (data-pid) each time this module receives the ack from the usb host (in a single transaction, in token is received, zero- length packet is transmitted, and then ack is received.). in this case, this module does not generate the brdy or bemp interrupt. (2) when the pertinent pipe is for bulk out transfer (type = 01 and dir = 0) when atrepm = 1 and pid = buf, this module returns nak in response to the out (or ping) token and generates the nrdy interrupt. modify this bit while cssts is 0 and pid is nak. before modifying this bit a fter modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 734 of 1262 rej09b0437-0100 bit bit name initial value r/w description 10 atrepm 0 r/w for usb communication in auto response mode, set this bit to 1 while the fifo buffer is empty. do not write to the fifo buffer during usb communication in auto response mode. when the pertinent pipe is for isochronous transfer, be sure to set this bit to 0. when the host controller function is selected, set this bit to 0. 9 aclrm 0 r/w auto buffer clear mode enables or disables automatic buffer clear mode for the pertinent pipe. 0: disabled 1: enabled (all buffers are initialized) to delete the information in the fifo buffer assigned to the pertinent pipe completely, write 1 and then 0 to this bit continuously. table 17.12 shows the information cleared by writing 1 and 0 to this bit continuously and the cases in which clearing the information is necessary. modify this bit while cssts is 0 and pid is nak. before modifying this bit a fter modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 735 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 sqclr 0 r/w * 1 toggle bit clear this bit should be set to 1 to clear the expected value (to set data0 as t he expected value) of the sequence toggle bit for the next transaction of the pertinent pipe. 0: invalid 1: specifies data0. setting this bit to 1 through software allows this module to set data0 as the expected value of the sequence toggle bit of the pertinent pipe. this module always sets this bit to 0. when the host controller function is selected, setting this bit to 1 for the pipe for bulk out transfer, this module starts the next trans fer of the pertinent pipe with the ping token. set the sqclr bit to 1 while cscts is 0 and pid is nak. before modifying this bit a fter modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 736 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 sqset 0 r/w * 1 toggle bit set this bit should be set to 1 to setdata1 as the expected value of the sequence toggle bit for the next transaction of the pertinent pipe. 0: invalid 1: specifies data1. setting this bit to 1 through software allows this module to set data1 as the expected value of the sequence toggle bit of the pertinent pipe. this module always sets this bit to 0. set the sqset bit to 1 while cssts is 0 and pid is nak. before modifying this bit a fter modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. 6 sqmon 0 r toggle bit confirmation indicates the expected val ue of the sequence toggle bit for the next transaction of the pertinent pipe. 0: data0 1: data1 when the pertinent pipe is not for the isochronous transfer, this module allows this bit to toggle upon normal completion of the transaction. however, this bit is not allowed to toggle when a data-pid disagreement occurs during the receiving transfer.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 737 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 pbusy 0 r pipe busy this bit indicates whether the relevant pipe is used or not for the transaction. 0: the relevant pipe is not used for the transaction. 1: the relevant pipe is used for the transaction. this module modifies this bit from 0 to 1 upon start of the usb transaction for the pertinent pipe, and modifies the bit from 1 to 0 upon completion of one transaction. reading this bit after software has set pid to nak allows checking that modification of the pipe settings is possible. for details, refer to (1) pipe control register switching procedures under section 17.4.3, pipe control. 4 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 738 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1, 0 pid[1:0] 00 r/w response pid specifies the response type for the next transaction of the pertinent pipe. 00: nak response 01: buf response (depending on the buffer state) 10: stall response 11: stall response the default setting of these bits is nak. modify the setting to buf to use the pertinent pipe for usb transfer. tables 17.13 and 17.14 show the basic operation (operation when there are no errors in the transmitted and received packets) of this module depending on the pid bit setting. after modifying the setting of these bits through software from buf to nak during usb communication using the pert inent pipe, check that pbusy is 1 to see if usb communication using the pertinent pipe has actually entered the nak state. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. notes: 1. only 0 can be read and 1 can be written to. 2. only 1 can be written to.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 739 of 1262 rej09b0437-0100 table 17.11 meaning of bsts bit dir bit bfre bit dclrm bit meaning of bsts bit 0 0 0 1: the received data can be read from the fifo buffer. 0: the received data has been completely read from the fifo buffer. 1 setting prohibited 1 0 1: the received data can be read from the fifo buffer. 0: software has set bclr to 1 after the received data has been completely read from the fifo buffer. 1 1: the received data can be read from the fifo buffer. 0: the received data has been completely read from the fifo buffer. 1 0 0 1: the transmit data can be written to the fifo buffer. 0: the transmit data has been completely written to the fifo buffer. 1 setting prohibited 1 0 setting prohibited 1 setting prohibited table 17.12 information cleared by this module by setting aclrm = 1 no. information cleared by aclrm bit manipulation cases in which clearing the information is necessary 1 all the information in the fifo buffer assigned to the pertinent pipe (all the information in two fi fo buffer planes in double buffer mode) 2 the interval count value when the pertinent pipe is for isochronous transfer when the interval count value is to be reset 3 values of the internal flags related to the bfre bit when the bfre setting is modified 4 fifo buffer toggle control when the dblb setting is modified 5 values of the internal flags related to the transaction count when the transaction count function is forcibly terminated
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 740 of 1262 rej09b0437-0100 table 17.13 operation of this module dependi ng on pid setting (when host controller function is selected) pid transfer type transfer direction (dir bit) operation of this module 00 (nak) operation does not depend on the setting. operation does not depend on the setting. does not issue tokens. 01 (buf) bulk or interrupt operation does not depend on the setting. issues tokens while uact is 1 and the fifo buffer corresponding to the pertinent pipe is ready for transmission and reception. does not issue tokens while uact is 0 or the fifo buffer corresponding to the pertinent pipe is not ready for transmission or reception. isochronous operation does not depend on the setting. issues tokens irrespective of the status of the fifo buffer corresponding to the pertinent pipe. 10 (stall) or 11 (stall) operation does not depend on the setting. operation does not depend on the setting. does not issue tokens.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 741 of 1262 rej09b0437-0100 table 17.14 operation of this module depending on pid setting (when function controller function is selected) pid transfer type transfer direction (dir bit) operation of this module 00 (nak) bulk or interrupt operation does not depend on the setting. returns nak in resp onse to the token from the usb host. for the operation when atrepm is 1, refer to the description of the atrepm bit. isochronous operation does not depend on the setting. returns nothing in response to the token from the usb host. 01 (buf) bulk receiving direction (dir = 0) receives data and returns ack in response to the out token from the usb host if the fifo buffer corresponding to the pertinent pipe is ready for reception. returns nak if not ready. returns ack in resp onse to the ping token from the usb host if the fifo buffer corresponding to the pertinent pipe is ready for reception. returns nyet if not ready. interrupt receiving direction (dir = 0) receives data and returns ack in response to the out token from the usb host if the fifo buffer corresponding to the pertinent pipe is ready for reception. returns nak if not ready. bulk or interrupt transmitting direction (dir = 1) transmits data in response to the token from the usb host if the corresponding fifo buffer is ready for transmission. returns nak if not ready. isochronous receiving direction (dir = 0) receives data in response to the out token from the usb host if the fifo buffer corresponding to the pertinent pipe is ready for reception. discards data if not ready.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 742 of 1262 rej09b0437-0100 pid transfer type transfer direction (dir bit) operation of this module 01 (buf) isochronous transmitting direction (dir = 1) transmits data in response to the token from the usb host if the corresponding fifo buffer is ready for transmission. transmits the zero-length packet if not ready. 10 (stall) or 11 (stall) bulk or interrupt operation does not depend on the setting. returns stall in response to the token from the usb host. isochronous operation does not depend on the setting returns nothing in response to the token from the usb host. (2) pipenctr (n = 6 to 9) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r/w * 1 r/w r r r/w r/w * 1 r/w * 1 r r r r r r/w r/w bsts ? csclr cssts ? ? aclrm sqclr sqset sqmon pbusy ? ? ? pid[1:0] bit bit name initial value r/w description 15 bsts 0 r buffer status indicates the fifo buffer status for the pertinent pipe. 0: buffer access is disabled. 1: buffer access is enabled. the meaning of this bit depends on the settings of the dir, bfre, and dclrm bits as shown in table 17.11. 14 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 743 of 1262 rej09b0437-0100 bit bit name initial value r/w description 13 csclr 0 r/w * 1 c-split status clear bit setting this bit to 1 allows this module to clear the cssts bit of the pertinent pipe to 0. 0: writing invalid 1: clears the cssts bit to 0. for the transfer using the split transaction, to restart the next transfer with the s-split forcibly, set this bit to 1 through software. however, for the normal split transaction, this module automatically clears the cssts bit to 0 upon completion of the c-split; therefore, clearing the csst s bit through software is not necessary. controlling the cssts bit through this bit must be done while uact is 0 thus communication is halted or while no transfer is being performed with bus disconnection detected. setting this bit to 1 while cssts is 0 has no effect. when the function controller function is selected, be sure to write 0 to this bit.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 744 of 1262 rej09b0437-0100 bit bit name initial value r/w description 12 cssts 0 r/w cssts status bit indicates the c-split status of the split transaction when the host controller function is selected. 0: start-split (s-split) transaction being processed or the transfer not using the split transaction in progress 1: c-split transaction being processed this module sets this bit to 1 upon start of the c- split and clears this bit to 0 upon detection of c- split completion. indicates the valid value only when the host controller function is selected. 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 aclrm 0 r/w auto buffer clear mode * 3 * 4 enables or disables automatic buffer clear mode for the pertinent pipe. 0: disabled 1: enabled (all buffers are initialized) to delete the information in the fifo buffer assigned to the pertinent pipe completely, write 1 and then 0 to this bit continuously. table 17.15 shows the information cleared by writing 1 and 0 to this bit continuously and the cases in which clearing the information is necessary. modify this bit while cssts is 0 and pid is nak and before the pipe is select ed by the curpipe bits. before modifying this bit a fter modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 745 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 sqclr 0 r/w * 1 toggle bit clear * 3 * 4 this bit should be set to 1 to clear the expected value (to set data0 as t he expected value) of the sequence toggle bit for the next transaction of the pertinent pipe. 0: invalid 1: specifies data0. setting this bit to 1 through software allows this module to set data0 as the expected value of the sequence toggle bit of the pertinent pipe. this module always sets this bit to 0. when the host controller function is selected, setting this bit to 1 for the pipe for bulk out transfer, this module starts the next trans fer of the pertinent pipe with the ping token. set the sqclr bit to 1 while cscts is 0 and pid is nak. before modifying this bit a fter modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 746 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 sqset 0 r/w * 1 toggle bit set * 3 * 4 this bit should be set to 1 to set data1 as the expected value of the sequence toggle bit for the next transaction of the pertinent pipe. 0: invalid 1: specifies data1. setting this bit to 1 through software allows this module to set data1 as the expected value of the sequence toggle bit of the pertinent pipe. this module always sets this bit to 0. set the sqset bit to 1 while cssts is 0 and pid is nak. before modifying this bit a fter modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. 6 sqmon 0 r toggle bit confirmation indicates the expected val ue of the sequence toggle bit for the next transaction of the pertinent pipe. 0: data0 1: data1 when the pertinent pipe is not for the isochronous transfer, this module allows this bit to toggle upon normal completion of the transaction. however, this bit is not allowed to toggle when a data-pid disagreement occurs during the receiving transfer.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 747 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 pbusy 0 r pipe busy this bit indicates whether the relevant pipe is used or not for the transaction. 0: the relevant pipe is not used for the transaction. 1: the relevant pipe is used for the transaction. this module modifies this bit from 0 to 1 upon start of the usb transaction for the pertinent pipe, and modifies the bit from 1 to 0 upon completion of one transaction. reading this bit after software has set pid to nak allows checking that modification of the pipe settings is possible. for details, refer to (1) pipe control register switching procedures under section 17.4.3, pipe control. 4 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 748 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1, 0 pid[1:0] 00 r/w response pid specifies the response type for the next transaction of the pertinent pipe. 00: nak response 01: buf response (depending on the buffer state) 10: stall response 11: stall response the default setting of these bits is nak. modify the setting to buf to use the pertinent pipe for usb transfer. tables 17.13 and 17.14 show the basic operation (operation when there are no errors in the transmitted and received packets) of this module depending on the pid bit setting. after modifying the setting of these bits through software from buf to nak during usb communication using the pert inent pipe, check that pbusy is 1 to see if usb communication using the pertinent pipe has actually entered the nak state. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. this module modifies the setting of these bits as follows. ? this module sets pid to nak on recognizing the completion of the transfer when the pertinent pipe is in the receiving direction and software has set the shtnak bit for the selected pipe to 1. ? this module sets pid to stall (11) on receiving the data packet with the payload exceeding the maximum packet size of the pertinent pipe. ? this module sets pid to nak on detecting a usb bus reset when the function controller function is selected.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 749 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1, 0 pid[1:0] 00 r/w ? this module sets pid to nak on detecting a receive error such as a crc error three consecutive times when the host controller function is selected. ? this module sets pid to stall (11) on receiving the stall handshake when the host controller function is selected. to specify each response type, set these bits as follows. ? to make a transition from nak (00) to stall, set 10. ? to make a transition from buf (01) to stall, set 11. ? to make a transition from stall (11) to nak, set 10 and then 00. ? to make a transition from stall to buf, set 00 (nak) and then 01 (buf). notes: 1. only 0 can be read and 1 can be written to. 2. only 1 can be written to. 3. the aclrm, sqclr, or sqset bits s hould be set while cssts is 0 and pid is nak and before the pipe is selected by the curpipe bits. 4. before modifying aclrm, sqclr, or sq set bits after modifying the pid bits from buf to nak, it should be checked that c ssts and pbusy for the selected pipe are 0. however, if the pid bits have been modified to nak through hardware control, checking pbusy is not necessary.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 750 of 1262 rej09b0437-0100 table 17.15 information cleared by this module by setting aclrm = 1 no. information cleared by aclrm bit manipulation cases in which clearing the information is necessary 1 all the information in the fifo buffer assigned to the pertinent pipe 2 when the host controller function is selected, the interval count value when the pertinent pipe is for isochronous transfer when the interval count value is to be reset 3 values of the internal flags related to the bfre bit when the bfre setting is modified 4 values of the internal flags related to the transaction count when the transaction count function is forcibly terminated 17.3.37 pipen transaction counter enable registers (pipentre) (n = 1 to 5) pipentre is a register that enables or disables the transaction counter corresponding to pipe1 to pipe5, and clears the transaction counter. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r r r r/w r/w r rrrrrrrr ??????trenbtrclr?????? ? ? bit bit name initial value r/w description 15 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 751 of 1262 rej09b0437-0100 bit bit name initial value r/w description 9 trenb 0 r/w transaction counter enable enables or disables the transaction counter. 0: the transaction counter is disabled. 1: the transaction counter is enabled. for the pipe in the receiving direction, setting this bit to 1 after setting the total number of the packets to be received in the trncnt bits through software allows this module to control hardware as described below on having received the number of packets equal to the set value in the trncnt bits. ? in continuous transmission/reception mode (cntmd = 1), this module switches the fifo buffer to the cpu side even if the fifo buffer is not full on completion of reception. ? while shtnak is 1, this module modifies the pid bits to nak for the corresponding pipe on having received the number of packets equal to the set value in the trncnt bits. ? while bfre is 1, this module asserts the brdy interrupt on having received the number of packets equal to the set value in the trncnt bits and then reading out the last received data. for the pipe in the transmitting direction, set this bit to 0. when the transaction counter is not used, set this bit to 0. when the transaction counter is used, set the trncnt bits before setting this bit to 1. set this bit to 1 before receiving the first packet to be counted by the transaction counter. 8 trclr 0 r/w transaction counter clear clears the current value of the transaction counter corresponding to the pertinent pipe and then sets this bit to 0. 0: invalid 1: the current counter value is cleared.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 752 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. note: modify each bit in this register while csst s is 0 and pid is nak. before modifying each bit after modifying the pid bits fo r the corresponding pipe from bu f to nak, check that cssts and pbusy are 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. 17.3.38 pipen transaction counter registers (pipentrn) (n = 1 to 5) pipentrn is a transaction counter corresponding to pipe1 to pipe5. this register is initialized by a power-on reset, but retains the set value by a usb bus reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w trncnt[15:0] bit bit name initial value r/w description 15 to 0 trncnt[15:0] all 0 r/w transaction counter when written to: specifies the number of transactions to be transferred through dma. when read from: indicates the specified num ber of transactions if trenb is 0. indicates the number of currently counted transaction if trenb is 1.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 753 of 1262 rej09b0437-0100 bit bit name initial value r/w description 15 to 0 trncnt[15:0] all 0 r/ w this module increments the value of these bits by one when all of the following conditions are satisfied on receiving the packet. ? trenb is 1. ? (trncnt set value current counter value + 1) on receiving the packet. ? the payload of the received packet agrees with the set value in the mxps bits. this module clears the value of these bits to 0 when any of the following conditions are satisfied. ? all the following conditions are satisfied. trenb is 1. (trncnt set value = current counter value + 1) on receiving the packet. the payload of the received packet agrees with the set value in the mxps bits. ? all the following conditions are satisfied. trenb is 1. this module has received a short packet. ? all the following conditions are satisfied. trenb is 1. software has set the trclr bit to 1. for the pipe in the transmitting direction, set these bits to 0. when the transaction counter is not used, set these bits to 0. modify these bits while cssts is 0, pid is nak, and trenb is 0. before modifying these bits after modifying the pid bits for the corresponding pipe from buf to nak, check that cssts and pbusy ar e 0. however, if the pid bits have been modified to nak by this module, checking pbusy through software is not necessary. to modify the value of these bits, set trncnt to 1 before setting trenb to 1.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 754 of 1262 rej09b0437-0100 17.3.39 device address n configuration registers (devaddn) (n = 0 to a) devaddn is a register that specifies the addr ess and port number of the hub to which the communication target peripheral de vice is connected and that also specifies the transfer speed of the peripheral device for pipe0 to pipea. when the host controller function is selected, this register should be set before starting communication using each pipe. the bits in this register should be modified while no valid pipes are using the settings of this register. valid pipes refer to the ones satisfying both of condition 1 and 2 below. 1. this register is select ed by the devsel bits as the communication target. 2. the pid bits are set to buf for the selected pi pe or the selected pipe is the dcp with sureq being 1. this register is initialized by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r/w r/w r/w r/w r/w r/w r/w r/w r/w r r r r r r ? upphub[3:0] hubport[2:0] usbspd[1:0] ???? ? ? bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 755 of 1262 rej09b0437-0100 bit bit name initial value r/w description 14 to 11 upphub[3:0] 0000 r/w address of hub to which communication target is connected specifies the usb address of the hub to which the communication target peripheral device is connected. 0000: the peripheral device is directly connected to the port of this lsi. 0001 to 1010: usb address of the hub 1011 to 1111: setting prohibited when the host controller f unction is selected, this module refers to the setting of these bits to generate packets for split transactions. when the function controller function is selected, set these bits to 0000. 10 to 8 hubport[2:0] 000 r/w port number of hub to which communication target is connected specifies the port number of the hub to which the communication target peripheral device is connected. 000: the peripheral device is directly connected to the port of this lsi. 001 to 111: port number of the hub when the host controller f unction is selected, this module refers to the setting of these bits to generate packets for split transactions. when the function controller function is selected, set these bits to 000.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 756 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7, 6 usbspd[1:0] 00 r/w transfer speed of the communication target device specifies the usb transfer speed of the communication target peripheral device. 00: devaddn is not used. 01: low speed 10: full speed 11: high speed when the host controller f unction is selected, this module refers to the setting of these bits to generate packets. when the function controller function is selected, set these bits to 00. 5 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 757 of 1262 rej09b0437-0100 17.3.40 bus wait register (d0fwait, d1fwait) d0fwait and d1fwait each specify the number of access wa its for those registers of this module that are connected to the internal bu s (that is, d0fwait, d1fwait, d0fifo, and d1fifo). the basic clock for this module is a usb clock of 48 mhz, and access from the internal bus is performed through b synchronization. for this reason, the usb clock must be multiplied by a certain number of cycles when accessing regi sters of this module via the internal bus. the number of access waits should be adjusted to produce at least the approximate value shown below: 83.4 ns (usb clock 4 cycles) when the size of access is 32 bits, 41.7 ns (usb clock 2 cycles) when the size of access is 16 b its, or 20.8 ns (usb clock 1 cycle) when the size of access is 8 bits. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 00000 00000011 rrrrrrrrrrrrr/wr/wr/wr/w 0 ?????????? ? ? 11 bwait[3:0] bit bit name initial value r/w description 15 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 to 0 bwait[3:0] 1111 r/w bus wait between dmac and fifo on a b basis, set the number of waits needed when accessing registers of this module via the internal bus. 0000: 0 wait (accessing two cycles on a b basis) 0001: 1 wait (accessi ng three cycles on a b basis) 0010: 2 waits (accessi ng four cycles on a b basis) : 1111: 15 waits (accessing 17 cycles on a b basis) note: be sure to set this bit in the initialization routine of this module by taking into account the b and access size.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 758 of 1262 rej09b0437-0100 17.4 operation 17.4.1 system control and oscillation control this section describes the register operations that are necessary to the initial settings of this module, and the registers necessary for power consumption control. (1) resets table 17.16 lists the types of controller resets. fo r the initialized states of the registers following the reset operations, see sectio n 17.3, register description. table 17.16 types of reset name operation power-on reset low level input from the resetp pin or writing of 1 to the rst bit in usbexr. note: power-on resets described in this manual include resets using the rst bit as well as those using the resetp pin usb bus reset automatically detected by this module from the d + and d ? lines when the function controller function is selected (2) controller function selection this module can select the host controller function or function controller function using the dcfm bit in syscfg. changing the dcfm bit should be done in the initial settings immediately after a power-on reset or in the d+ pull-up disabled (dprpu = 0) and d + /d ? pull-down disabled (drpd = 0) state. (3) enabling high-speed operation this module can select a usb communication speed (communication bit rate) using software. when the host controller function is selected, either of the high-speed operation or full-speed/low- speed operation can be selected. in order to enab le the high-speed operatio n for this module, the hse bit in syscfg should be set to 1. if high-speed mode has been enabled, this module executes the reset handshake protocol, and the usb communication speed is set automatically. the results of the reset handshake can be co nfirmed using the rhst bit in dvstctr. if high-speed operation has been disabled, this module operates at full-speed or low-speed. if the function controller function is also selected, this module operates at full-speed.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 759 of 1262 rej09b0437-0100 changing the hse bit should be done between the attch interrupt detection and bus reset execution when the host controller function is selected, or with the d+ line pull-up disabled (dprpu = 0) when the host controller function is selected. (4) usb data bus resistor control figure 17.1 shows a diagram of the connections between this module and the usb connectors. this module incorporates a pull-up resistor for the d+ signal and a pull-down resistor for the d+ and d- signals. these signals can be pulled up or down using the dprpu and drpd bits in syscfg. this module controls the terminal resistor for the d+ and d- signals during high-speed operation and the output resistor for the signals during full-speed operation. this module automatically switches the resistor after connection with the host controller or peripheral device by means of reset handshake, suspended st ate and resume detection. when the function controller function is selected and the dprpu bit in syscfg is cleared to 0 during communication with the host controller, the pull-up resistor (or the terminal resistor) of the usb data line is disabled, making it possible to notify the usb host of the device disconnection.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 760 of 1262 rej09b0437-0100 legend this lsi : output impedance : pull-down resistor : pull-up resistor d- d+ usb connector dp dm z pd z dru z dru z pd z pu z pu z pd z dru figure 17.1 ubs connector connection
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 761 of 1262 rej09b0437-0100 17.4.2 interrupt functions table 17.17 lists the interrupt generation conditions for this module. when an interrupt generation condition is satisfied and the interrupt output is enabled using the corresponding interrupt enable register, this mo dule issues a usb interrupt request to the intc. table 17.17 interrupt generation conditions bit interrupt name cause of interrupt function that generates the interrupt related status vbint vbus interrupt when a ch ange in the state of the vbus input pin has been detected (low to high or high to low) host, function vbsts resm resume interrupt when a change in the state of the usb bus has been detected in the suspended state (j-state to k-state or j-state to se0) function ? sofr frame number update interrupt when the host controller function is selected: ? when an sof packet with a different frame number has been transmitted when the function controller function is selected: ? sofrm = 0: when an sof packet with a different frame number is received ? sofrm = 1: when the sof with the frame number 0 cannot be received due to a corruption of a packet host, function ? dvst device state transition interrupt when a device state transition is detected ? a usb bus reset detected ? the suspend state detected ? set_address request received ? set_configuration request received function dvsq
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 762 of 1262 rej09b0437-0100 bit interrupt name cause of interrupt function that generates the interrupt related status ctrt control transfer stage transition interrupt when a stage transition is detected in control transfer ? setup stage completed ? control write transfer status stage transition ? control read transfer status stage transition ? control transfer completed ? a control transfer sequence error occurred function ctsq bemp buffer empty interrupt ? when transmission of all of the data in the buffer memory has been completed ? when an excessive maximum packet size error has been detected host, function bempsts. pipebemp nrdy buffer not ready interrupt when the host controller function is selected: ? when stall is received from the peripheral side for the issued token ? when a response cannot be received correctly from the peripheral side for the issued token (no response is returned three consecutive times or a packet reception error occurred three consecutive times.) ? when an overrun/underrun occurred during isochronous transfer when the function controller function is selected: ? when nak is returned for an in/out/ping token. ? when a crc error or a bit stuffing error occurred during data host, function nrdysts. pipenrdy
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 763 of 1262 rej09b0437-0100 bit interrupt name cause of interrupt function that generates the interrupt related status reception in isochronous transfer ? when an overrun/underrun occurred during data reception in isochronous transfer brdy buffer ready interrupt when the buffer is ready (reading or writing is enabled) host, function brdysys pipebrdy bchg bus change interrupt when a change of usb bus state is detected host, function ? dtch disconnection detection during full-speed operation when disconnection of a peripheral device during full-speed operation is detected host ? attch device connection detection when j-state or k-st ate is detected on the usb port for 2.5 s. used for checking whether a peripheral device is connected. host ? eoferr eof error detection when eof error of a peripheral device is detected host ? sack normal setup operation when the normal response (ack) for the setup transaction is received host ? sign setup error when a setup transaction error (no response or ack packet corruption) is detected three consecutive times. host ? note: all the bits without register name indication are in intsts0.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 764 of 1262 rej09b0437-0100 figure 17.2 shows a diagram relating to interrupts of this module. usb bus reset detected set_address detected set_configuration detected suspended state detected bemp interrupt enable register control write data stage control read data stage completion of control transfer control transfer setup reception control transfer error vbse intenb0 intsts0 rsme sofe dvse ctre bempe nrdye brdye vbint resm sofr dvst bchge intenb1 intsts1 dtche signe sacke bchg dtch attche eoferre at t c h eoferr sign sack ctrt bemp nrdy brdy : : b9 ... b1 b0 b9 b1 b0 bemp interrupt status register nrdy interrupt enable register : : b9 ... b1 b0 b9 b1 b0 nrdy interrupt status register brdy interrupt enable register : : b9 ... b1 b0 b9 b1 b0 brdy interrupt status register generation circuit interrupt request . . . . . . . . . figure 17.2 items relating to interrupts
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 765 of 1262 rej09b0437-0100 (1) brdy interrupt the brdy interrupt is generated when either of the host controller function or function controller function is selected. the following shows the conditions under which this module sets 1 to a corresponding bit in brdysts. under this cond ition, this module generates brdy interrupt, if software sets the pipebrdye bit in brdyenb that corresponds to the pipe to 1 and the brdye bit in intenb0 to 1. the conditions for generating and clearing the brdy interrupt depend on the settings of the brdym bit and bfre bit for the pertinent pipe as described below. (a) when the brdym bit is 0 and bfre bit is 0 with these settings, the brdy interrupt indicat es that the fifo port is accessible. on any of the following conditions, this module generates the internal brdy interrupt request trigger and sets 1 to the pipebrdy bit corresponding to the pertinent pipe. (i) for the pipe in the transmitting direction: ? when software changes the dir bit from 0 to 1. ? when packet transmission is completed usi ng the pertinent pipe when write-access from the cpu to the fifo buffer for the pertinent pipe is disabled (when the bsts bit is read as 0). ? in continuous transmission/reception mode, the request trigger is generated on completion of transmitting data of one plane of the fifo buffer. ? when one fifo buffer is empty on completion of writing data to the other fifo buffer in double buffer mode. ? the request trigger is not generated until completion of writing data to the currently-written fifo buffer plane even if transmission to the other fifo buffer is completed. ? when the hardware flushes the buffer of the pipe for isochronous transfers. ? when 1 is written to the aclrm bit, which causes the fifo buffer to make transition from the write-disabled to write-enabled state. the request trigger is not generated for the dcp (that is, during data transmission for control transfers).
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 766 of 1262 rej09b0437-0100 (ii) for the pipe in th e receiving direction: ? when packet reception is comple ted successfully thus enabling the fifo buffer to be read when read-access from the cpu to the fifo buffer for the pertinent pipe is disabled (when the bsts bit is read as 0). the request trigger is not generated for the transaction in which data-pid disagreement occurs. in continuous transmission/reception mode, th e request trigger is not generated when the data is of the specified maximum packet size and the buffer has available space. when a short packet is received, the request trigger is generated even if the fifo buffer has available space. when the transaction counter is used, the re quest trigger is generated on receiving the specified number of packets. in this case, the request trigger is generated even if the fifo buffer has available space. ? when one fifo buffer is read-enabled on completion of reading data from the other fifo buffer in double buffer mode. the request trigger is not generated until co mpletion of reading data from the currently- read fifo buffer plane even if reception by the other fifo buffer is completed. when the function controller function is selected , the brdy interrupt is not generated in the status stage of control transfers. the pipebrdy interrupt status of the pertinent pipe can be cleared to 0 by writing 0 to the corresponding pipebrdy interrupt status bit in the brdysts register through software. in this case, 1s should be written to the pipebrdy in terrupt status bits for the other pipes. be sure to clear the brdy status be fore accessing the fifo buffer.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 767 of 1262 rej09b0437-0100 (b) when the brdym bit is 0 and the bfre bit is 1 with these settings, this module generates the brdy interrupt on completion of reading all the data for a single transfer using the pipe in the r eceiving direction, and se ts 1 to the pipebrdy bit corresponding to the pertinent pipe. on any of the following conditions, this module dete rmines that the last data for a single transfer has been received. ? when a short packet in cluding a zero-length packet is received. ? when the transaction counter register (trncn t bits) is used and th e number of packets specified by the trncnt bits are completely received. when the pertinent data is completely read out after any of the above determination conditions has been satisfied, this module determines that all th e data for a single transfer has been completely read out. when a zero-length packet is receive d when the fifo buffer is empt y, this module determines that all the data for a single transfer has been completely read out upon passing the zero-length packet data to the cpu. in this case, to start the next transfer, write 1 to the bclr bit in the corresponding fifoctr register through software. with these settings, this module does not detect the brdy interrupt for the pipe in the transmitting direction. the pipebrdy interrupt status of the pertinent pipe can be cleared to 0 by writing 0 to the corresponding pipebrdy interrupt status bit through software. in this case, 1s should be written to the pipebrdy interrupt status bits for the other pipes. in this mode, the bfre bit setting should not be modi fied until all the data for a single transfer has been processed. when it is necessary to modify the bfre bit before completion of processing, all the fifo buffers for the pertinent pipe should be cleared using the aclrm bit.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 768 of 1262 rej09b0437-0100 (c) when the brdym bit is 1 and the bfre bit is 0 with these settings, the pipebrdy values are lin ked to the bsts bit settings for each pipe. in other words, the brdy interrupt status bits (pipebrdy) are set to 1 or 0 by this module depending on the fifo buffer status. (i) for the pipe in the transmitting direction: the brdy interrupt status bits are set to 1 when the fifo buffer is write- enabled and are set to 0 when write-disabled. however, the brdy interrupt is not generated if the dcp in the transmitting direction is write- enabled. (ii) for the pipe in th e receiving direction: the brdy interrupt status bits are set to 1 when the fifo buffer is read-enabled and are set to 0 when all the data have been read (read-disabled). when a zero-length packet is receive d when the fifo buffer is empty, the pertinent b it is set to 1 and the brdy interrupt is continuously generated until bclr = 1 is written through software. with this setting, the pipebrdy bit cannot be cleared to 0 through software. when brdym is set to 1, all of the bfre bits (for all pipes) should be cleared to 0. figure 17.3 shows the timing at which the brdy interrupt is generated.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 769 of 1262 rej09b0437-0100 token packet token packet token packet ack handshake ack handshake ack handshake data packet buffer read buffer write zero-length packet/ short data packet/ data packet (full) (transaction count) short data packet/ data packet (transaction count) a brdy interrupt is generated because reading from the buffer is enabled. a brdy interrupt is generated because the transfer has ended. a brdy interrupt is generated because writing to the buffer is enabled. (1) zero-length packet reception or data packet reception when bfre = 0 (short packet reception/transaction counter completion/buffer full) (2) data packet reception when bfre = 1 (short packet reception/transaction counter completion) (3) packet transmission usb bus usb bus usb bus brdy interrupt brdy interrupt brdy interrupt figure 17.3 timing at which a brdy interrupt is generated
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 770 of 1262 rej09b0437-0100 (2) nrdy interrupt on generating the internal nrdy interrupt request for the pipe whose pid bits are set to buf by software, this module sets the corresponding pipenrdy bit in nrdysts to 1. if the corresponding bit in nrdyenb is set to 1 by software, this module sets the nrdy bit in intsts0 to 1, allowing the usb interrupt to be generated. the following describes the conditions on which this module generates the internal nrdy interrupt request for a given pipe. however, the internal nrdy interrupt request is not generated during setup transaction execution when the host controller function is selected. during setup transactions when the host controller function is selected, the sack or sign interrupt is detected. the internal nrdy interrupt request is not generated during status stage execution of the control transfer when the function controller function is selected. (a) when the host controller function is selected and when the connection is used in which no split transactions occur (i) for the pipe in the transmitting direction: on any of the following conditions, this module detects the nrdy interrupt. ? for the pipe for isochronous transfers, when the time to issue an out token comes in a state in which there is no data to be transmitted in the fifo buffer. in this case, this module transmits a zero-le ngth packet following the out token, setting the corresponding pipenrdy bit and the ovrn bit to 1. ? during communications other than setup transactions using the pipe for the transfers other than isochronous transfers, when any combination of the following two cases occur three consecutive times: 1) no response is returned from the peripheral device (when timeout is detected before detection of the handshake pa cket from the peripheral device) and 2) an error is detected in the packet from the peripheral device. in this case, this module sets the corres ponding pipenrdy bit to 1 and modifies the setting of the pid bits of the corresponding pipe to nak. ? during communications other than setup transactions, when the stall handshake is received from the peripheral device (including the stall handshake in response to ping in addition to the stall handshake in response to out). in this case, this module sets the corres ponding pipenrdy bit to 1 and modifies the setting of the pid bits of the corresponding pipe to stall (11).
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 771 of 1262 rej09b0437-0100 (ii) for the pipe in the receiving direction ? for the pipe for isochronous transfers, when th e time to issue an in token comes in a state in which there is no space av ailable in the fifo buffer. in this case, this module dis cards the received data for the in token, setting the pipenrdy bit of the corresponding pipe and the ovrn bit to 1. when a packet error is detected in the received data for the in token, this module also sets the crce bit to 1. ? for the pipe for the transfers other than isochronous transfers, when any combination of the following two cases occur three consecutive tim es: 1) no response is returned from the peripheral device for the in token issued by this module (when timeout is detected before detection of the data packet from the periphera l device) and 2) an error is detected in the packet from the pe ripheral device. in this case, this module sets the corres ponding pipenrdy bit to 1 and modifies the setting of the pid bits of the corresponding pipe to nak. ? for the pipe for isochronous transfers, when no response is returned from the peripheral device for the in token (when timeout is detected before detection of the data packet from the peripheral device) or an error is det ected in the packet from the peripheral device. in this case, this module sets the corresp onding pipenrdy bit to 1. (the setting of the pid bits of the corresponding pipe to nak is not modified.) ? for the pipe for isochronous transfers, when a crc error or a bit stuffing error is detected in the received data packet. in this case, this module sets the corr esponding pipenrdy bit and crce bit to 1. ? when the stall handshake is received. in this case, this module sets the corres ponding pipenrdy bit to 1 and modifies the setting of the pid bits of the corresponding pipe to stall.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 772 of 1262 rej09b0437-0100 (b) when the host controller function is selected and when the connection is used in which split transactions occur (i) for the pipe in the transmitting direction: ? for the pipe for isochronous transfers, when the time to issue an out token comes in a state in which there is no data to be transmitted in the fifo buffer. in this case, this module transmits a zero-le ngth packet following the out token, setting the corresponding pipenrdy bit and the ovrn bit to 1 at the issuance of the start-split transaction (s-split). ? for the pipe for the transfers other than isochronous transfers, when any combination of the following two cases occur three consecutive tim es: 1) no response is returned from the hub for the s-split or complete-split trans action (c-split) (when timeout is detected before detection of the handshake packet from the hub) and 2) an error is detected in the packet from the hub. in this case, this module sets the pipenrdy bit of the corresponding pipe to 1 and modifies the setting of the pid bits of the corresponding pipe to nak. if the nrdy interrupt is detected when th e c-split is issued, this module clears the cssts bit to 0. ? when the stall handshake is received in response to the c-split. in this case, this module sets the correspond ing pipenrdy bit to 1, modifies the setting of the pid bits of the corresponding pipe to stall (11) and clears the cssts bit to 0. this interrupt is not detected for setup transactions. ? when the nyet is received in response to th e c-split and the microframe number = 4. in this case, this module sets the corres ponding pipenrdy bit to 1 and clears the cssts bit to 0 (does not modify the setting of the pid bits).
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 773 of 1262 rej09b0437-0100 (ii) for the pipe in th e receiving direction: ? for the pipe for isochronous transfers, when th e time to issue an in token comes in a state in which there is no space av ailable in the fifo buffer. in this case, this module discards the r eceived data for the in token, setting the corresponding pipenrdy bit an d the ovrn bit to 1 at the issuance of the s-split. ? during bulk-pipe transfers or the transfers other than setup transactions with the dcp, when any combination of the following two cas es occur three consecutive times: 1) no response is returned from the hub for the in token issued by this module at the issuance of s-split or c-split (when timeout is detected before detection of the data packet from the hub) and 2) an error is det ected in the packet from the hub. in this case, this module sets the corres ponding pipenrdy bit to 1 and modifies the setting of the pid bits of the corresponding pi pe to nak. when the condition is generated during the c-split trans action, this module clears the cssts bit to 0. ? during the c-split transaction fo r the pipe for isochronous tran sfers or interrupt transfers, when any combination of the following two cas es occur three consecutive times: 1) no response is returned from the hub for the in token issued by this module (when timeout is detected before detection of th e data packet from the hub) an d 2) an error is detected in the packet from the hub. on generating this condition for the pipe for interrupt transfers, this module sets the corresponding pipenrdy bit to 1, modifi es the setting of the pid bits of the corresponding pipe to nak an d clears the cssts bit to 0. on generating this condition for the pipe for isochronous transfers, this module sets the corresponding pipenrdy bit to 1 and crce bit to 1, and clears the cssts bit to 0 (does not modify the setting of the pid bits). ? during the c-split transactio n, when the stall handshake is received for the pipe for the transfers other than isochronous transfers. in this case, this module sets the correspond ing pipenrdy bit to 1, modifies the setting of the pid bits of the corresponding pipe to stall (11) and clears the cssts bit to 0. ? during the c-split transaction, when the nyet handshake is received for the pipe for the isochronous transfers or interrupt transfers and the microframe number = 4. in this case, this module sets the correspond ing pipenrdy bit to 1 and crce bit to 1, and clears the cssts bit to 0 (does not modify the setting of the pid bits).
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 774 of 1262 rej09b0437-0100 (c) when the function controller function is selected (i) for the pipe in the transmitting direction: ? on receiving an in token when there is no data to be transmitted in the fifo buffer. in this case, this module generates a nrdy interrupt request at the reception of the in token, setting the pipenrdy bit to 1. for the pipe for the isochronous transfers in which an interrupt is generated, this module transm its a zero-length packet, setting the ovrn bit to 1. (ii) for the pipe in th e receiving direction: ? on receiving an out token when there is no space available in the fifo buffer. for the pipe for the isochronous transfers in which an interrupt is generated, this module generates a nrdy interrupt request, setting the pipenrdy bit to 1 and ovrn bit to 1. for the pipe for the transfers other than isoc hronous transfers in which an interrupt is generated, this module generates a nrdy interrupt request when a nak handshake is transferred after the data following the out token was received, setting the pipenrdy bit to 1. however, during re-transmission (due to data-pid disagreement), the nrdy interrupt request is not generated. in addition, if an error occurs in the data packet, the nrdy interrupt request is not generated. ? on receiving a ping token when there is no space available in the fifo buffer. in this case, this module generates a nrdy interrupt request at th e reception of the ping token, setting the pipenrdy bit to 1. ? for the pipe for isochronous tr ansfers, when a token is not received normally within an interval frame. in this case, this module generates a nrdy interrupt request, setting the pipenrdy bit to 1.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 775 of 1262 rej09b0437-0100 figure 17.4 shows the timing at which an nrdy interrupt is generated when the function controller function is selected. in token packet nak handshake nak handshake nak handshake out token packet data packet ping packet (1) data transmission (2) data reception: out token reception (3) data reception: ping token reception usb bus nrdy interrupt usb bus nrdy interrupt (crc error, etc) usb bus nrdy interrupt figure 17.4 timing at which nrdy interr upt is generated when function controller function is selected
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 776 of 1262 rej09b0437-0100 (3) bemp interrupt on generating the bemp interrupt for the pipe whose pid bits are set to buf by software, this module sets the corresponding pipebemp bit in bempsts to 1. if the correspondin g bit in bempenb is set to 1 by software, this module se ts the bemp bit in intsts0 to 1, allowing the usb interrupt to be generated. the following describes the conditions on which this module generates the internal bemp interrupt request. (a) for the pipe in the transmitting direction, when the fifo buffer of the corresponding pipe is empty on completion of transmission (including zero-length packet transmission). in single buffer mode, the internal bemp interrupt request is generated simultaneously with the brdy interrupt for the pipe other than dcp. however, the internal bemp interrupt request is not generated on any of the following conditions. ? when software (dmac) has already started wr iting data to the fifo buffer of the cpu on completion of transmitting data of one plane in double buffer mode. ? when the buffer is cleared (emptied) by setting the aclrm or bclr bit to 1. ? when in transfer (zero- length packet transmission) is perf ormed during the control transfer status stage in function controller mode. (b) for the pipe in the receiving direction: when the successfully-received data packet si ze exceeds the specified maximum packet size. in this case, this module generates the bemp interrupt request, setting the corresponding pipebemp bit to 1, and discards the received data and modifies the setti ng of the pid bits of the corresponding pipe to stall (11). here, this module returns no response when used as the host controller, and returns stall response when used as the function controller. however, the internal bemp interrupt request is not generated on any of the following conditions. ? when a crc error or bit stuffing error is detected in the received data. ? when a setup transaction is being performed.writing 0 to the pipebemp bit clears the status; writing 1 to the pipebemp bit has no effect.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 777 of 1262 rej09b0437-0100 figure 17.5 shows the timing at which a bemp inte rrupt is generated when the function controller function has been selected. in token packet stall handshake ack handshake out token packet data packet data packet (1) data transmission (2) data reception usb bus bemp interrupt usb bus bemp interrupt figure 17.5 timing at which bemp interrupt is generated when function controller function is selected (4) device state transition interrupt figure 17.6 shows a diagram of this module device state transitions. this module controls device states and generates device state transition interrupt s. however, recovery from the suspended state (resume signal detection) is det ected by means of the resume inte rrupt. the device state transition interrupts can be enabled or disabled individually using intenb0. the device state that made a transition can be confirmed usin g the dvsq bit in intsts0. to make a transition to the default state, the devi ce state transition interrupt is generated after the reset handshake protocol has been completed. device state can be controlled only when the func tion controller function is selected. also, the device state transition interrupts can be generated only when the function controller function is selected.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 778 of 1262 rej09b0437-0100 powered state (dvsq = 100) suspended state (dvsq = 100) default state (dvsq = 001) suspended state (dvsq = 101) address state (dvsq = 010) suspended state (dvsq = 110) configured state (dvsq = 011) suspended state (dvsq = 111) suspended state detection (dvst is set to 1.) usb bus reset detection (dvst is set to 1.) suspended state detection (dvst is set to 1.) suspended state detection (dvst is set to 1.) setaddress execution (dvst is set to 1.) setaddress execution (address = 0) (dvst is set to 1.) suspended state detection (dvst is set to 1.) setconfiguration execution (configuration value = 0) (dvst is set to 1.) setconfiguration execution (configuration value = 0) (dvst is set to 1.) resume (resm is set to 1) resume (resm is set to 1) resume (resm is set to 1) resume (resm is set to 1) usb bus reset detection (dvst is set to 1.) / figure 17.6 device state transitions
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 779 of 1262 rej09b0437-0100 (5) control transfer stage transition interrupt figure 17.7 shows a diagram of how this module handles the control transfer stage transition. this module controls the control transfer sequence and generates control transfer stage transition interrupts. control transfer stage transition interrupts can be enabled or disabled individually using intenb0. the transfer stage that made a tran sition can be confirmed using the ctsq bit in intsts0. the control transfer stage transition interrupts ar e generated only when the function controller function is selected. the control transfer sequence errors are descri bed below. if an error occurs, the pid bit in dcpctr is set to b'1x (stall). (a) during control read transfers ? at the in token of the data stage, an out or ping token is received when there have been no data transfers at all. ? an in token is receive d at the status stage ? a packet is received at the status stage fo r which the data packet is datapid = data0 (b) during control write transfers ? at the out token of the data stage, an in to ken is received when there have been no ack response at all ? a packet is received at the data stage fo r which the first data packet is datapid = data0 ? at the status stage, an out or ping token is received
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 780 of 1262 rej09b0437-0100 (c) during no-data control transfers ? at the status stage, an out or ping token is received at the control write transfer stag e, if the number of receive data exceeds the wlength value of the usb request, it cannot be recognized as a control transfer sequence error. at the control read transfer status stage, packets other than zero-l ength packets are received by an ack response and the transfer ends normally. when a ctrt interrupt occurs in response to a sequence error (serr = 1), the ctsq = 110 value is retained until ctrt = 0 is written from the syst em (the interrupt status is cleared). therefore, while ctsq = 110 is being held, the ctrt interrupt that ends the setup stage will not be generated even if a new usb request is received. (this module retains th e setup stage end, and after the interrupt status has been cleared by software, a setup stage end interrupt is generated.) 1 ctsq = 001 control read data stage 2 ctsq = 010 control read status stage 4 ctsq = 000 idle stage 3 ctsq = 100 control write status stage 1 ctsq = 101 control write no data status stage 5 ctsq = 110 control transfer sequence error ctsq = 000 setup stage 1 ctsq = 011 control write data stage setup token reception setup token reception setup token reception error detection out token in token ack trans- mission ack reception ack reception note: ctrt interrupts (1) setup stage completed (2) control read transfer status stage transition (3) control write transfer status stage transition (4) control transfer completed (5) control transfer sequence error 4 error detection and in token reception are valid at all stages in the box. ack trans- mission ack transmission ack transmission figure 17.7 control tr ansfer stage transitions
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 781 of 1262 rej09b0437-0100 (6) frame update interrupt figure 17.8 shows an example of the sofr interrupt output timing of this module. with the host controller function selected, an interrupt is generated at the timing at which the frame number is updated. with the function controller function selected, the sofr interrupt is generated when the frame number is updated. when the function controller function is selected, this module updates the frame number and generates an sofr interrupt if it detects a new sof packet during full-speed operation. during high-speed operation, however, this module does not update the frame number, or generates no sofr interrupt until the module enters the sof locked state. also , the sof interpolation function is not activated. the sof lock state is the state in which sof packets with different frame numbers are received twice con tinuously w ithout error occurrence. the conditions under which the sof lock monitoring begins and stops are as follows. 1. conditions under which sof lock monitoring begins usbe = 1 2. conditions under which sof lock monitoring stops usbe = 0, a usb bus reset is receive d, or suspended st ate is detected. 6 701 670 701 701 70 1 2 7012345670123456701 346 peripheral device sof packet sof packet sof lock sof number sof number sof lock frame number sofr interrupt sofr interrupt sof interpolation sof interpolation function sof interpolation sof interpolation sof interpolation, missing not locked not locked figure 17.8 example of so fr interrupt output timing
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 782 of 1262 rej09b0437-0100 (7) vbus interrupt if there has been a change in the vbus pin, the vbus interrupt is generated. the level of the vbus pin can be checked with the vbsts bit in intsts0. whether the host controller is connected or disconnected can be confirmed using the vbus interrupt. however, if the system is activated with the host controller connected, the first vbus interrupt is not generated because there is no change in the vbus pin. (8) resume interrupt the resm interrupt is generated when the device state is the suspended state, and the usb bus state has changed (from j-state to k-state, or from j-st ate to se0). recovery from the suspended state is detected by mean s of the resume interrupt. (9) bchg interrupt the bchg interrupt is generated when the usb bus state has changed. the bchg interrupt can be used to detect whether or not the peripheral device is connected when the host controller function has been selected and can also be used to detect a remote wakeup. the bchg interrupt is generated regardless of whether the host controller function or function controller function has been selected. (10) dtch interrupt the dtch interrupt is generated if disconnection of the usb bus is detected when the host controller function has been selected. this module detects bus disconnection based on usb specification 2.0. after detecting the dtch interrupt, this module controls hardware as described below (irrespective of the set value of the corresponding interrupt enable bit). software should terminate all the pipes in which communications are currently carried out for the pertinent port and make a transition to the wait state for bus connection to the pertinent port (wait state for attch interrupt generation). (a) modifies the uact bit for the port in whic h a dtch interrupt has been detected to 0. (b) puts the port in which a dtch interrupt has been generated into the idle state.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 783 of 1262 rej09b0437-0100 (11) sack interrupt the sack interrupt is generated when an ack response for the transmitted setup packet has been received from the peripheral device with the host co ntroller function select ed. the sack interrupt can be used to confirm that the setup transaction has been completed successfully. (12) sign interrupt the sign interrupt is generated when an ack response for the transmitted setup packet has not been correctly received from the peripheral device three consecutive times wi th the host controller function selected. the sign interrupt can be used to detect no ack response transmitted from the peripheral device or corruption of an ack packet. (13) attch interrupt the attch interrupt is generated when j-state or k-state of the full-speed or low-speed level signal is detected on the usb port for 2.5 s in host controller mode. to be more specific, the attch interrupt is detected on any of the following conditions. (a) when k-state, se0, or se1 changes to j-state, and j-state continues 2.5 s. (b) when j-state, se0, or se1 changes to k-state, and k-state continues 2.5 s. (14) eoferr interrupt the eoferr interrupt is generated when it is det ected that communicatio n is not completed at the eof2 timing prescribed by usb specification 2.0. after detecting the eoferr interrupt, this module controls hardware as described below (irrespective of the set value of the corresponding interrupt enable bit). software should terminate all the pipes in which communica tions are currently carried out fo r the pertinent port and perform re-enumeration of the pertinent port. (a) modifies the uact bit for the port in which an eoferr interrupt has been detected to 0. (b) puts the port in which an eoferr interrupt has been generated into the idle state.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 784 of 1262 rej09b0437-0100 17.4.3 pipe control table 17.18 lists the pipe setting items of this module. with usb data transfer, data transmission has to be carried out using the logic pipe called the endpoint. this module has ten pipes that are used for data transfer. settings should be entered for each of the pipes in conjunction with the specifications of the system. table 17.18 pipe setting items register name bit name setting contents remarks type specifies the transfer type pipe1 to pipe9: can be set bfre selects the brdy interrupt mode pipe1 to pipe5: can be set dblb selects a double buffer pipe1 to pipe5: can be set cntmd selects continuous transfer or non- continuous transfer pipe1 and pipe2: can be set (only when bulk transfer has been selected). pipe3 to pipe5: can be set dir selects transfer direction in or out can be set epnum endpoint number pipe1 to pipe9: can be set a value other than 0000 should be set when the pipe is used. dcpcfg pipecfg shtnak selects disabled state for pipe when transfer ends pipe1 and pipe2: can be set (only when bulk transfer has been selected) pipe3 to pipe5: can be set pipebuf bufsize buffer memory size dcp: cannot be set (fixed at 256 bytes) pipe1 to pipe5: can be set (a maximum of 2 kbytes can be specified) pipe6 to pipe9: cannot be set (fixed at 64 bytes)
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 785 of 1262 rej09b0437-0100 register name bit name setting contents remarks bufnmb buffer memory number dcp: cannot be set (areas fixed at h'0 to h'3) pipe1 to pipe5: can be set (can be specified in areas h'8 to h'7f) pipe6 to pipe9: cannot be set (areas fixed at h'4 to h'7) devsel selects a device referenced only when the host controller function is selected. dcpmaxp pipemaxp mxps maximum packet size compliant with the usb standard. ifis buffer flush pipe1 and pipe2: can be set (only when isochronous transfer has been selected) pipe3 to pipe5: cannot be set pipe6 to pipe9: can be set (only when the host controller function has been selected) pipeperi iitv interval counter pipe1 and pipe2: can be set (only when isochronous transfer has been selected) pipe3 to pipe5: cannot be set pipe6 to pipe9: can be set (only when the host controller function has been selected) dcpctr pipenctr bsts buffer status for the dcp, receive buffer status and transmit buffer status are switched with the isel bit. inbufm in buffer monitor m ounted for pipe3 to pipe5. sureq setup request can be set only for the dcp. can be controlled only when the host controller function has been selected. sureqclr sureq clear can be set only for the dcp. can be controlled only when the host controller function has been selected. csclr cssts clear can be controll ed only when the host controller function has been selected. cssts split status indication can be referenced only when the host controller function has been selected.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 786 of 1262 rej09b0437-0100 register name bit name setting contents remarks atrepm auto response mode pipe1 to pipe5: can be set can be controlled only when the function controller function has been selected. dcpctr pipenctr aclrm auto buffer clear pi pe1 to pipe9: can be set sqclr sequence clear clears the data toggle bit sqset sequence set sets the data toggle bit sqmon sequence monitor monitors the data toggle bit pbusy pipe busy status pid response pid see sectio n 17.4.3 (6), response pid trenb transaction counter enable pipe1 to pipe5: can be set pipentre trclr current transaction counter clear pipe1 to pipe5: can be set pipentrn trncnt transaction counter pipe1 to pipe5: can be set
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 787 of 1262 rej09b0437-0100 (1) pipe control register switching procedures the following bits in the pipe control registers can be modified only when usb communication is disabled (pid = nak): registers that should not be set in the us b communication enable d (pid = buf) state ? bits in dcpcfg and dcpmaxp ? the sqclr and sqset bits in dcpctr ? bits in pipecfg, pipebuf, pipemaxp and pipeperi ? the atrepm, aclrm, sqclr and sqset bits in pipexctr ? bits in pipextre and pipextrn in order to modify the above bits from the usb communication enabled (pid = buf) state, follow the procedure shown below: 1. generate a bit modification request with the pipe control register. 2. modify the pid corresponding to the pipe to nak. 3. wait until the corresponding cssts bit is cleared to 0 (only when the host controller function has been selected). 4. wait until the corresponding pbusy bit is cleared to 0. 5. modify the bits in the pipe control register. the following bits in the pipe control registers can be modified only when the pertinent information has not been set by the curpipe bits in cfifosel, d0fifosel and d1fifosel. registers that should not be set wh en curpipe in fifo-port is set. ? bits in dcpcfg and dcpmaxp ? bits in pipecfg, pipebuf, pipemaxp and pipeperi in order to modify pipe information, the curpipe bits should be set to the pipes other than the pipe to be modified. for the dcp, the buffer should be cleared using bclr after the pipe information is modified.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 788 of 1262 rej09b0437-0100 (2) transfer types the type bit in pipepcfg is used to specify the transfer type for each pipe. the transfer types that can be set for the pipes are as follows. 1. dcp: no setting is necessary (fixed at control transfer). 2. pipe1 and pipe2: these should be set to bulk transfer or isochronous transfer. 3. pipe3 to pipe5: these should be set to bulk transfer. 4. pipe6 to pipe9: these should be set to interrupt transfer. (3) endpoint number the epnum bit in pipepcfg is used to set the endpoint number for each pipe. the dcp is fixed at endpoint 0. the other pipes can be set from endpoint 1 to endpoint 15. 1. dcp: no setting is necessary (fixed at end point 0). 2. pipe1 to pipe9: the endpoint numbers from 1 to 15 should be selected and set. these should be set so that the combination of the dir bit and epnum bit is unique. (4) maximum packet size setting the mxps bit in dcpmaxp and pipemaxp is us ed to specify the maximum packet size for each pipe. dcp and pipe1 to pipe5 can be set to any of the maximum pipe sizes defined by the usb specification. for pipe6 to pi pe9, 64 bytes are the upper lim it of the maximum packet size. the maximum packet size should be set before beginning the transfer (pid = buf). 1. dcp: 64 should be set when using high-speed operation. 2. dcp: select and set 8, 16, 32, or 64 when using full-speed operation. 3. pipe1 to pipe5: 512 should be set when using high-speed bulk transfer. 4. pipe1 to pipe5: select and set 8, 16, 32, or 64 when using full-speed bulk transfer. 5. pipe1 and pipe2: set a value between 1 and 1024 when using high-speed isochronous transfer. 6. pipe1 and pipe2: set a value between 1 and 1023 when using full-speed isochronous transfer. 7. pipe6 to pipe9: set a value between 1 and 64. the high bandwidth transfers used with interrupt transfers and isochronous transfers are not supported.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 789 of 1262 rej09b0437-0100 (5) transaction counter (for pipe1 to pipe5 in reading direction) when the specified number of transactions have been completed in the data packet receiving direction, this module recognizes that the transfer has ended. the transaction counter function is available when the pipes assigned to the d0fifo/d1fifo port have been set in the direction of reading data from the buffer memory. two transact ion counters are provided: one is the trncnt register that specifies the number of transactions to be executed and the other is the current counter that internally counts the number of executed transactions. when the current counter value matches the number of the transactions specifi ed in trncnt, reading the buffer memory is enabled. the current counter of th e transaction counter function is in itialized by the trclr bit, so that the transactions can be counted again starting from the beginning. the information read from trncnt differs depending on the setting of the trenb bit. ? trenb = 0: the specified transaction counter value can be read. ? trenb = 1: the current counter value indicating the internally counted number of executed transactions can be read. when operating the trclr bit, the following should be noted. ? if the transactions are being counted and pid = buf, the current counter cannot be cleared. ? if there is any data left in the buffer, the current counter cannot be cleared. (6) response pid the pid bits in dcpctr and pipenctr are used to set the response pid for each pipe. the following shows this module operation with various response pid settings: (a) response pid settings when the host controller function is selected: the response pid is us ed to specify the exec ution of transactions. (i) nak setting: using pipes is disabled. no transaction is executed. (ii) buf setting: transactions are executed base d on the status of the buffer memory. for out direction: if there are tran smit data in the buffer memory, an out token is issued. for in direction: if there is an area to receive data in the buffer me mory, an in token is issued. (iii) stall setting: using pipes is di sabled. no transaction is executed. setup transactions for the dcp are set with the sureq bit.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 790 of 1262 rej09b0437-0100 (b) response pid settings when the functi on controller function is selected: the response pid is used to specify the response to transactions from the host. (i) nak setting: the nak response is always returned in response to the generated transaction. (ii) buf setting: responses are ma de to transactions based on the status of the buffer memory. (iii) stall setting: the stall response is always returned in response to the generated transaction. for setup transactions, an ack response is always returned, regardless of the pid setting, and the usb request is stored in the register. this module may carry out writing to the pid bits, depending on the results of the transaction. (c) when the host controller function has been selected and the response pid is set by hardware: (i) nak setting: in the following cases, pid = nak is set and issuing of tokens is automatically stopped: ? when a transfer other than isochronous transfer has been performed and the nrdy interrupt is generated. (for details, see descriptions of the nrdy interrupt.) ? if a short packet is received when the shtnak bit in pipecfg has been set to 1 for bulk transfer. ? if the transaction counter ended when the shtnak bit has been set to 1 for bulk transfer. (ii) buf setting: there is no buf writing by this module. (iii) stall setting: in the following cases, pid = stall is set and issuing of tokens is automatically stopped: ? when stall is received in response to the transmitted token. ? when the size of the receive data packet exceeds the maximum packet size.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 791 of 1262 rej09b0437-0100 (d) when the function controller function has b een selected and the response pid is set by hardware: (i) nak setting: in the following cases, pid = nak is set and nak is always returned in response to transactions: ? when the setup token is received normally (dcp only). ? if the transaction counter ended or a short p acket is received when the shtnak bit in pipecfg has been set to 1 for bulk transfer. (ii) buf setting: there is no buf writing by this module. (iii) stall setting: in the following cases, pid = stall is set and stall is always returned in response to transactions: ? when the size of the receive data packet exceeds the maximum packet size. ? when a control transfer sequence error has been detected (dcp only). (7) data pid sequence bit this module automatically toggles the sequence b it in the data pid when data is transferred normally in the control transfer data stage, bulk transfer and interrupt tran sfer. the sequence bit of the data pid that was transmitted can be confirmed with the sqmon bit in dcpctr and pipenctr. when data is transmitted, the sequence bit switches at the timing at which the ack handshake is received. when data is received, the sequence bit switches at the timing at which the ack handshake is transmitted. the sqclr bit in dcpctr and the sqset bit in pipenctr can be used to change the data pid sequence bit. when the function controller function has been selected and control transfer is used, this module automatically sets the sequence bit when a stage transition is made. data0 is returned when the setup stage is ended and data1 is returned in a st atus stage. therefore, so ftware settings are not required. however, when the host controller func tion has been selected and control transfer is used, the sequence bit should be set by software at the stage transition. for the clearfeature request transm ission or reception, the data pi d sequence bit should be set by software, regardless of whether the host controller function or function controller function is selected. with pipes for which isochronous transfer has been set, sequence bit operation cannot be carried out using the sqset bit.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 792 of 1262 rej09b0437-0100 (8) response pid = nak function this module has a function that disables pipe operation (pid response = nak) at the timing at which the final data packet of a transaction is received (this mo dule automatically distinguishes this based on reception of a short packet or the tr ansaction counter) by setting the shtnak bit in pipecfg to 1. when a double buffer is being used for the buffer memory, using this function enables reception of data packets in transfer units. if pipe operation has disabled, the pipe has to be set to the enabled state again (pid response = buf) using software. this function can be used only when bulk transfers are used. (9) auto transfer mode with the pipes for bulk transfer (pipe1 to pipe5), when the atrepm bit in pipenctr is set to 1, a transition is made to auto response mode. during an out transfer (dir = 0), out-nak mode is entered, and during an in transfer (dir = 1), null auto response mode is entered. (a) out-nak mode with the pipes for bulk out transfer, nak is returned in response to an out or ping token and an nrdy interrupt is output when the atrepm bit is set to 1. to make a transition from normal mode to out-nak mode, out-nak mode should be specified in the pipe operation disabled state (response pid = nak) before enabling pipe operation (response pid = buf). after pipe operation has been enabled, out-nak mode becomes valid. however, if an out token is received immediately before pipe operation is disabled, the token data is normally received, and an ack is retuned to the host. to make a transition from out-nak mode to normal mode, out-nak mode should be canceled in the pipe operation disabled state (response pid = nak) before enabling pipe operation (response pid = buf). in normal mode, reception of out data is enabled and an ack is returned in response to a ping token if the buffer is ready to receive data.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 793 of 1262 rej09b0437-0100 (b) null auto response mode with the pipes for bulk in transfer, zero-length packets are continuously transmitted when the atrepm bit is set to 1. to make a transition from normal mode to null auto response mode, null auto response mode should be set in the pipe operation disabled state (response pid = nak) before enabling pipe operation (response pid = buf). after pipe operation has been enabled, null auto response mode becomes valid. before setting null auto response mode, inbufm = 0 should be confirmed because the mode can be set only when the buffer is empty. if the inbufm bit is 1, the buffer should be emptied with the aclrm bit. while a transition to null auto response mode is being made, data should not be written from the fifo port. to make a transition from null auto response mode to normal mode, pipe operation disabled state (response pid = nak) should be retained for the period of zero-length packet transmission (full- speed: 10 s, high-speed: 3 s) before canceling null auto response mode. in normal mode, data can be written from the fifo port; therefore, pa cket transmission to the host is enabled by enabling pipe operation (response pid = buf).
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 794 of 1262 rej09b0437-0100 17.4.4 fifo buffer memory (1) fifo buffer memory allocation figure 17.9 shows an example of a fifo buffer memory map for this module. the fifo buffer memory is an area shared by the cpu and this mo dule. in the fifo buffer memory status, there are times when the access right to th e buffer memory is allocated to the user system (cpu side), and times when it is allocated to this module (sie side). the buffer memory sets independ ent areas for each pipe. in the me mory areas, 64 bytes comprise one block, and the memory areas are set using the first block number of the number of blocks (specified using the bufnmb and bufsize bits in pipebuf). independent buffer memory areas should be set fo r each pipe. each memory area can be set using the first block number and the number of blocks (specified using the bufnmb and bufsize bits in pipebuf), where one block comprises 64 bytes. when continuous transfer mode has been selected using the cntmd bit in pipencfg, the bufsize bits should be set so that the buffer memory size should be an integral multiple of the maximum packet size. when double buffer mode has been selected using the dblb bit in pipencfg, two planes of the me mory area specified using the bufsize bits in pipebuf can be assigned to a single pipe. moreover, three fifo ports are used for access to the buffer memory (reading and writing data). a pipe is assigned to the fifo port by specifying the pipe number using the curpipe bit in c/dnfifosel. the buffer statuses of the various pipes can be confirmed using the bsts bit in dcpctr and the inbufm bit in pipenctr. also, the access right of the fifo port can be confirmed using the frdy bit in cfifoctr or dnfifoctr.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 795 of 1262 rej09b0437-0100 buffer memory pipebuf registers bufnmb = 0, bufsize = 3 bufnmb = 4, bufsize = 0 bufnmb = 5, bufsize = 0 bufnmb = 6, bufsize = 3 bufnmb = 10, bufsize = 7 bufnmb = 18, bufsize = 3 bufnmb = 22, bufsize = 7 bufnmb = 28, bufsize = 2 pipe0 pipe6 pipe7 pipe5 pipe1 pipe2 pipe3 pipe4 curpipe = 1 curpipe = 3 curpipe = 6 fifo port cfifo port d0fifo port d1fifo port figure 17.9 example of a buffer memory map (a) buffer status tables 17.19 and 17.20 show the buffer status. the buffer memory status can be confirmed using the bsts bit in dcpctr and the inbufm bit in pipenctr. the access direction for the buffer memory can be specified using either the dir bit in pipencfg or the isel bit in cfifosel (when dcp is selected). the inbufm bit is valid for pipe0 to pipe5 in the sending direction. for an in pipe uses double buffer, software can refer the bsts bit to monitor the buffer memory status of cpu side and the inbufm bit to monito r the buffer memory status of sie side. in the case like the bemp interrupt may not shows the buffer empty status because the cpu (dmac) writes data slowly, software can use the inbufm bit to confirm the end of sending.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 796 of 1262 rej09b0437-0100 table 17.19 buffer status indicated by the bsts bit isel or dir bsts buffer memory state 0 (receiving direction) 0 there is no re ceived data, or data is being received. reading from the fifo port is inhibited. 0 (receiving direction) 1 there is receiv ed data, or a zero-length packet has been received. reading from the fifo port is allowed. however, because reading is not possible when a zero- length packet is received, the buffer must be cleared. 1 (transmitting direction) 0 the transmission has not been finished. writing to the fifo port is inhibited. 1 (transmitting direction) 1 the transmission has been finished. cpu write is allowed. table 17.20 buffer status indicated by the inbufm bit idir inbufm buffer memory state 0 (receiving direction) invalid invalid 1 (transmitting direction) 0 the transmission has been finished. there is no waiting data to be transmitted. 1 (transmitting direction) 1 the fifo port has written data to the buffer. there is data to be transmitted
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 797 of 1262 rej09b0437-0100 (b) fifo buffer clearing table 17.21 shows the clearing of the fifo buffer memory by this module. the buffer memory can be cleared using the th ree bits indicated below. table 17.21 list of buffer clearing methods bit name bclr dclrm aclrm register cfifoctr dnfifoctr dnfifosel pipenctr function clears the buffer memory on the cpu side in this mode, after the data of the specified pipe has been read, the buffer memory is cleared automatically. this is the auto buffer clear mode, in which all of the received packets are discarded. clearing method cleared by writing 1 1: mode valid 0: mode invalid 1: mode valid 0: mode invalid (c) buffer areas table 17.22 shows the fifo buffer memory map of this controller. the buff er memory has special fixed areas to which pipes are assigned in advan ce, and user areas that can be set by the user. the buffer for the dcp is a special fixed area th at is used both for control read transfers and control write transfers. the pipe6 to pipe9 area is assigned in advance, but the area for pipes that are not being used can be assigned to pipe1 to pipe5 as a user area. the settings should ensure that the various pipes do not overlap. note that each area is twice as large as the setting value in the double buffer. also, the buffer size should not be specified usin g a value that is less than the maximum packet size.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 798 of 1262 rej09b0437-0100 table 17.22 buffer memory map buffer memory number buffer size pipe setting note h'0 64 bytes fixed area only for the dcp single buffer, continuous transfers enabled h'1 to h'3 ? prohibited to be used ? h'4 64 bytes fixed area for pipe6 single buffer h'5 64 bytes fixed area for pipe7 single buffer h'6 64 bytes fixed area for pipe8 single buffer h'7 64 bytes fixed area for pipe9 single buffer h'8 to h'7f up to 7616 bytes pipe1 to pipe5 user area double buffer can be set, continuous transfers enabled (d) auto buffer clear mode function with this module, all of the recei ved data packets are discarded if the aclrm bit in pipenctr is set to 1. if a normal data packet has been received, the ack response is returned to the host controller. this function can be set only in the buffer memory reading direction. also, if the aclrm bit is set to 1 and then to 0, the buffer memory of the selected pipe can be cleared regardless of the access direction. an access cycle of at least 100 ns is required between aclrm = 1 and aclrm = 0. (e) buffer memory specifications (single/double setting) either a single or double buffer can be selected for pipe1 to pipe5, using the dblb bit in pipencfg. the double buffer is a function that assigns two memory ar eas specified with the bufsize bit in pipebuf to the same pipe. figure 17.10 shows an example of buffer memory settings for this module.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 799 of 1262 rej09b0437-0100 buffer memory pipebuf registers 64 bytes 64 bytes 64 bytes 128 bytes bufsize = 0, dblb = 0 bufsize = 0, dblb = 1 bufsize = 1, dblb = 0 figure 17.10 example of buffer memory settings (f) buffer memory operation (continuous transfer setting) either the continuous transfer mode or the non-c ontinuous transfer mode can be selected, using the cntmd bit in pipencfg. this selection is valid for pipe1 to pipe5. the continuous tran sfer mode function is a function that sends and receives multiple transactions in succession. when the continuous tr ansfer mode is set, data can be transferred without interrupts being issued to the cpu, up to the buffe r sizes assigned for each of the pipes. in the continuous sending mode, the data being written is divided into packets of the maximum packet size and sent. if the data being sent is less than the buffer size (short packet, or the integer multiple of the maximum packet size is less than the buffer size), bval = 1 must be set after the data being sent has been written. in the continuous reception mode, in terrupts are not issued during r eception of packets up to the buffer size, until the transaction counter ha s ended, or a short packet is received. table 17.23 describes the relationship between the transfer mode settings by cntmd bit and the timings at which reading data or transmitting data from the fifo buffer is enabled.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 800 of 1262 rej09b0437-0100 table 17.23 relationship between transfer mode settings by cntmd bit and timings at which reading data or transmitting data from fifo buffer is enabled continuous or non- continuous transfer mode when reading data or tran smitting data is enabled in the receiving direction (dir = 0), reading data from the fifo buffer is enabled when: ? this module receives one packet. non-continuous transfer (cntmd = 0) in the transmitting direction (dir = 1), transmitting data from the fifo buffer is enabled when: ? software (or dmac) writes data of the maximum packet size to the fifo buffer. or ? software (or dmac) writes data of the short packet size (including 0- byte data) to the fifo buffer and then writes 1 to bval. in the receiving direction (dir = 0), reading data from the fifo buffer is enabled when: ? the number of the data bytes received in the fifo buffer assigned to the selected pipe becomes the same as the number of assigned data bytes ((bufsize + 1) * 64). ? this module receives a short packet other than a zero-length packet. ? this module receives a zero-length packet when data is already stored in the fifo buffer assi gned to the selected pipe. or ? this module receives the number of packets equal to the transaction counter value specified for the selected pipe by software. continuous transfer (cntmd = 1) in the transmitting direction (dir = 1), transmitting data from the fifo buffer is enabled when: ? the number of the data bytes writt en to the fifo buffer by software (or dmac) becomes the same as the number of data bytes in a single fifo buffer plane assigned to the selected pipe. or ? software (or dmac) writes to the fifo buffer the number of data bytes less than the size of a single fifo buffer plane (including 0-byte data) assigned to the selected pipe and then writes 1 to bval.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 801 of 1262 rej09b0437-0100 figure 17.11 shows an example of buffer memory operation for this module. cntmd = 0 when packet is received cntmd = 1 when packet is received cntmd = 0 when packet is sent cntmd = 1 when packet is sent max packet size max packet size max packet size max packet size max packet size max packet size unused area unused area interrupt issued interrupt issued transmission enabled transmission enabled figure 17.11 example of buffer memory operation (2) fifo port functions table 17.24 shows the settings for the fifo port functions of this module. in write access, writing data until the buffer is full (or the maximu m packet size for non-co ntinuous transfers) automatically enables sending of the data. to enable sending of data before the buffer is full (or before the maximum packet size for non-continuous transfers), the bval bit in c/dnfifoctr must be set to end the writing. also, to send a zero-length p acket, the bclr bit in the same register must be used to clear the buffer and then the bval bit set in order to end the writing. in read access, reception of new packets is automati cally enabled if all of the data has been read. data cannot be read when a zero-length packet is being received (dtln = 0), so the bclr bit in the register must be used to release the buffe r. the length of the data being received can be confirmed using the dtln bit in c/dnfifoctr.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 802 of 1262 rej09b0437-0100 table 17.24 fifo port function settings register name bit name function note rcnt selects dtln read mode rew buffer memory rewind (re-read, rewrite) dclrm automatically clears data received for a specified pipe after the data has been read for dnfifo only dreqe enables dma transfers for dnfifo only mbw fifo port access bit width bigend selects fifo port endian isel fifo port access direction c/dnfifosel curpipe selects the current pipe for dcp only bval ends writing to the buffer memory bclr clears the buffer memory on the cpu side c/dnfifoctr dtln checks the length of received data (a) fifo port selection table 17.24 shows the pipes that can be selected with the various fifo ports. the pipe to be accessed is selected using the curpipe bit in c/dn fifosel. after the pipe is selected, whether the curpipe value for the pipe which was written last can be correctly read should be checked. (if the previous pipe number is read, it indicates that the pipe modification is being executed by this module.) then, the fifo port can be accessed after frdy = 1 is checked . also, the bus width to be accessed should be selected using the mbw bit. the buffer memory access direction conforms to the di r bit in pipencfg. the isel bit determines this only for the dcp. table 17.25 fifo port access categorized by pipe pipe access method port that can be used dcp cpu access cfifo port register cpu access cfifo port register d0fifo/d1fifo port register pipe1 to pipe9 dma access d0fifo/d1fifo port register
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 803 of 1262 rej09b0437-0100 (b) rew bit it is possible to temporarily stop access to th e pipe currently being accessed, access a different pipe, and then continue processing using the current pipe once again. the rew bit in c/dnfifosel is used for this. if a pipe is selected when the rew bit is set to 1 and at the same time the curpipe bit in c/dnfifosel is set, the pointer used for reading fr om and writing to the buffer memory is reset, and reading or writing can be carried out from the first byte. also, if a pipe is selected with 0 set for the rew bit, data can be read and written in co ntinuation of the previous selection, without the pointer used for reading from and writing to the buffer memory being reset. to access the fifo port, frdy = 1 must be ensured after selecting a pipe. (3) dma transfers (d0fifo/d1fifo port) (a) overview of dma transfers for pipes 1 to 9, the fifo port can be accessed using the dmac. when accessing the buffer for the pipe targeted for dma transfer is enabled, a dma transfer request is issued. the unit of transfer to the fifo port should be selected using the mb w bit in dnfifosel and the pipe targeted for the dma tr ansfer should be selected usin g the curpipe bit. the selected pipe should not be changed during the dma transfer. (b) auto recognition of dma transfer completion with this module, it is possible to complete fifo data writing through dma transfer by controlling dma transfer end signal input. when a transfer end signal is sampled, the module enables buffer memo ry transmission (the same condition as when bval = 1). (c) dnfifo auto clear mode (d0fifo/ d1fifo port reading direction) if 1 is set for the dclrm bit in dnfifosel, the module automatically clears the buffer memory of the selected pipe when reading of the data from the buffer memory has been completed. table 17.26 shows the packet r eception and buffer memory clearin g processing for each of the various settings. as shown, the buffer clear conditions depend on the value set to the bfre bit. using the dclrm bit eliminates the need for the buffer to be cleared by software even if a situation occurs that necessitates clearing of the buffer. this makes it possible to carry out dma transfers without involving software. this function can be set only in the buffer memory reading direction.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 804 of 1262 rej09b0437-0100 table 17.26 packet recep tion and buffer memory clearing processing register setting dclrm = 0 dclrm = 1 buffer status when packet is received bfre = 0 bfre = 1 bfre = 0 bfre = 1 buffer full doesn't need to be cleared doesn't need to be cleared doesn't need to be cleared doesn't need to be cleared zero-length packet reception needs to be cleared needs to be cleared doesn't need to be cleared doesn't need to be cleared normal short packet reception doesn't need to be cleared needs to be cleared doesn't need to be cleared doesn't need to be cleared transaction count ended doesn't need to be cleared needs to be cleared doesn't need to be cleared doesn't need to be cleared 17.4.5 control transfers (dcp) data transfers of the data stage of control transfers are done using the default control pipe (dcp). the dcp buffer memory is a 256-byte single buff er, and is a fixed area that is shared for both control reading and control writing. the buffer memory can be accessed through the cfifo port. (1) control transfers when the host controller function is selected (a) setup stage usqreq, usbval, usbindx, and usbleng are the registers that are used to transmit a usb request for setup transactions. writing setup packet data to the registers and writing 1 to the sureq bit in dcpctr transmits the specified da ta for setup transactions. upon completion of transactions, the sureq bit is cleared to 0. the above usb re quest registers should not be modified while sureq = 1. the device address fo r setup transactions is specified using the devsel bits in dcpmaxp. when the data for setup transactions has been sent, a sign or sack interrupt request is generated according to the response received from the peripheral device (sign1 or sack bi ts in intsts1), by means of which the result of the setup transactions can be confirmed. a data packet of data0 (usb request) is transmitted as the data packet for the setup transactions regardless of the setting of the sqmon bit in dcpctr.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 805 of 1262 rej09b0437-0100 (b) data stage data transfers are done using the dcp buffer memory. the access direction of the dcp bu ffer memory should be speci fied using the isel bit in cfifosel. for the first data packet of the data stage, the da ta pid must be transferred as data1. transaction is done by setting the data pid = data1 and the pid bit = buf using the sqset bit in dcpcfg. completion of data transfer is de tected using the brdy and bemp interrupts. setting continuous transfer mode allows data transfers over multiple packets. note that when continuous transfer mode is set for the receiving direction, the brdy interrupt is not generated until the buffer becomes fu ll or a short packet is received (t he integer multiple of the maximum packet size, and less than 256 bytes). for control write transfers, when the number of data bytes to be sent is the integer multiple of the maximum packet size, software must control so as to send a zero-length packet at the end. (c) status stage zero-length packet data transfers ar e done in the direction opposite to that in the data stage. as with the data stage, data transfers are done us ing the dcp buffer memory . transactions are done in the same manner as the data stage. for the data packets of the status stage, the data pid must be transferred as data1. the data pid should be set to data1 using the sqset bit in dcpcfg. for reception of a zero-length p acket, the received data length must be confirmed using the dtln bits in cfifoctr after the brdy interrupt is ge nerated, and the buffer memory must then be cleared using the bclr bit.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 806 of 1262 rej09b0437-0100 (2) control transfers when the function controller function is selected (a) setup stage this module always sends an ack response in resp onse to a setup packet that is normal with respect to this module. the opera tion of this module operates in the setup stage is noted below. (i) when a new usb request is received, th is module sets the following registers: ? set the valid bit in intsts0 to 1. ? set the pid bit in dcpctr to nak. ? set the ccpl bit in dcpctr to 0. (ii) when a data packet is r eceived right after the setup packet, the usb request parameters are stored in usbreq, usbval, usbindx, and usbleng. response processing with respect to the control tr ansfer should always be carried out after first setting valid = 0. in the valid = 1 state, pid = buf cannot be set, and the data stage cannot be terminated. using the function of the valid bit, this module is able to interrupt the processing of a request currently being processed if a ne w usb request is received during a control transfer, and can send a response in response to the newest request. also, this module automatically judges the direction bit (bit 8 of the bmrequesttype) and the request data length (wlength) of the usb request that was received, and then distinguishes between control read transfers, co ntrol write transf ers, and no-data control transfers, and controls the stage transition. for a wron g sequence, the sequence error of the control transfer stage transition interrupt is generated, and the software is notified. for information on the stage control of this module, see figure 17.7. (b) data stage data transfers corresponding to usb requests that have been r eceived should be done using the dcp. before accessing the dcp buffer memory, the access directio n should be specified using the isel bit in cfifosel. if the data being transferred is larger than the size of the dcp buffer memory, the data transfer should be carried out using the brdy interrupt for control write transfers and the bemp interrupt for control read transfers. with control write transfers during high-speed operation, the nyet handshake response is carried out based on the state of the buffer memory.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 807 of 1262 rej09b0437-0100 (c) status stage control transfers are term inated by setting the ccpl bit to 1 with the pid bit in dcpctr set to pid = buf. after the above settings have been entered, this module automatically execut es the status stage in accordance with the data tr ansfer direction determined at the se tup stage. the specific procedure is as follows. (i) for control read transfers: this module sends a zero-length packet and r eceives an ack response from the usb host. (ii) for control write transfers and no-data cont rol transfers: the zero-length packet is receiv ed from the usb host, and this module sends an ack response. (d) control transfer auto response function this module automatically responds to a normal set_address request. if any of the following errors occur in the set_address request, a response from the software is necessary. (i) any transfer other than a cont rol read transfer: bmrequesttype h'00 (ii) if a request error occurs: windex h'00 (ii) for any transfer other than a no-data c ontrol transfer: wlength h'00 (iv) if a request error occurs: wvalue > h'7f (v) control transfer of a device state error: dvsq = 011 (configured) for all requests other than the set_address request, a response is required from the corresponding software.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 808 of 1262 rej09b0437-0100 17.4.6 bulk transfers (pipe1 to pipe5) the buffer memory specificati ons for bulk transfers (single/double buffer setting, or continuous/non-continuous transfer mode setting) can be selected. the maximum size that can be set for the buffer memory is 2 k bytes. the buffer memory state is controlled by this module, with a response sent automatically fo r a ping packet/nyet handshake. (1) ping packet control when the host controller function is selected this module automatically sends a pi ng packet in the out direction. on receiving an ack handshake in the initial stat e in which ping packet sending mode is set, this module sends an out packet as noted be low. reception of an nak or nyet handshake returns this module to ping packet sending mode. this control also applies to the control transfers in the data stage and status stage. 1. sets out data sending mode. 2. sends a ping packet. 3. receives an ack handshake. 4. sends an out data packet. 5. receives an ack handshake. (repeats steps 4 and 5.) 6. sends an out data packet. 7. receives an n ak/nyet handshake. 8. sends a ping packet. this module is returned to pi ng packet sending mode by a power-on reset, receiving a nyet/nak handshake, setting or clearing the se quence toggle bits (sqset and sqclr), and setting the buffer clear bit (aclrm) in pipenctr.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 809 of 1262 rej09b0437-0100 (2) nyet handshake control when the functi on controller function is selected table 17.27 shows the nyet handshake responses of this module. the nyet response of this module is made in conformance wi th the conditions noted below. wh en a short packet is received, however, the response will be an ack response instead of a nyet packet response. the same applies to the data stages of control write transfers. table 17.27 nyet handshake responses value set for pid bit in dcpctr buffer memory state token response note nak/stall ? setup ack ? ? in/out/ ping nak/stall ? buf ? setup ack ? rcv-brdy1 out/ping ack if an out token is received, a data packet is received. rcv-brdy2 out nyet notifies whether a data packet can be received rcv-brdy2 out (short) ack notifies whether a data packet can be received rcv-brdy2 ping ack notifies that a data packet can be received rcv-nrdy out/ping nak notifi es that a data packet cannot be received trn-brdy in data0/data1 a data packet is transmitted trn-nrdy in nak trn-nrdy [legend] rcv-brdy1: when an out/ping token is received, there is space in the buffer memory for two or more packets. rcv-brdy2: when an out token is received, ther e is only enough space in the buffer memory for one packet. rcv-nrdy: when a ping token is received, there is no space in the buffer memory. trn-brdy: when an in token is received, there is data to be sent in the buffer memory. trn-nrdy: when an in token is received, there is no data to be sent in the buffer memory.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 810 of 1262 rej09b0437-0100 17.4.7 interrupt transf ers (pipe6 to pipe9) when the function controller function is selected, this module carries out interrupt transfers in accordance with the tim ing controlled by the host controller. for interrupt transfers, ping packets are ignored (no responses are sent), and the ac k, nak, and stall resp onses are carried out without an nyet handshake response being made. when the host controller function is selected, this module can set the timing of issuing a token using the interval timer. at this time, this module issues an out token even in the out direction, without issuing a ping token. this module does not support high bandwidth transfers of interrupt transfers. (1) interval counter during int errupt transfers when the ho st controller function is selected for interrupt transfers, intervals between transacti ons are set in the iitv bits in pipeperi. this controller issues an interrupt transfer token based on the specified intervals. (a) counter initialization this controller initializes the interval counter under the following conditions. (i) power-on reset: the iitv bits are initialized. (ii) buffer memory initialization using the aclrm bit: the iitv bits are not initialized but the count value is. setting the aclrm bit to 0 starts counting from the value set in the iitv bits. note that the interval counter is not initialized in the following case. (iii) usb bus reset, usb suspended: the iitv bits are not initialized. setting 1 to the ua ct bit starts counting from the value before entering the usb bus reset st ate or usb suspended state.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 811 of 1262 rej09b0437-0100 (b) operation when transmission/reception is impossible at token issuance timing this module cannot issue tokens even at token issuance timing in the following cases. in such a case, this module attempts transactions at the subsequent interval. (i) when the pid is set to nak or stall. (ii) when the buffer memory is full at the token sending timing in the receiving (in) direction. (iii) when there is no data to be sent in the buffer memory at the token sending timing in the sending (out) direction. 17.4.8 isochronous transfers (pipe1 and pipe2) 1. this module has the following functions pertaining to isochronous transfers. 2. notification of isochronous transfer error information 3. interval counter (speci fied by the iitv bit) 4. isochronous in transfer data setup control (idly function) 5. isochronous in transfer buffer flush function (specified by the ifis bit) this module does not support the high bandwidth transfers of isochronous transfers. (1) error detection with isochronous transfers this module has a function for detecting the error information noted below, so that when errors occur in isochronous transfers, software can control them. tables 17.28 and 17.29 show the priority in which errors are confirmed and the interrupts that are generated. (i) pid errors ? if the pid of the packet being received is illegal (ii) crc errors and bit stuffing errors ? if an error occurs in the crc of the packet being received, or the bit stuffing is illegal (iii) maximum packet size exceeded ? the maximum packet size ex ceeded the set value.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 812 of 1262 rej09b0437-0100 (iv) overrun and underrun errors ? when host controller function is selected: ? when using isochronous in tran sfers (reception), the in toke n was received but the buffer memory is not empty. ? when using isochronous out transfers (transmission), the out token was transmitted, but the data was not in the buffer memory. ? when function controller function is selected: ? when using isochronous in transfers (transmission), the in token was received but the data was not in the buffer memory. ? when using isochronous out transfers (recep tion), the out token wa s received, but the buffer memory was not empty. (v) interval errors ? during an isochronous in transfer, the token c ould not be received during the interval frame. ? during an isochronous out tr ansfer, the out token was recei ved during frames other than the interval frame.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 813 of 1262 rej09b0437-0100 table 17.28 error detection when a token is received detection priority error generate d interrupt and status 1 pid errors no interrupts are generated in both cases when the host controller function is selected and the function controller function is selected (ignored as a corrupted packet). 2 crc error and bit stuffing errors no interrupts generated in both cases when the host controller function is selected and the function controller function is selected (ignored as a corrupted packet). 3 overrun and underrun errors an nrdy interrupt is generated to set the ovrn bit in both cases when host controller function is selected and function controller function is selected. when the host controller function is selected, no tokens are transmitted. when the function controller function is selected, a zero-length packet is transmitted in response to in token. however, no data packets are received in response to out token. 4 interval errors an nrdy interrupt is generated when the function controller function is selected. it is not generated when the host controller function is selected. table 17.29 error detection when a data packet is received detection priority order error genera ted interrupt and status 1 pid errors no interrupts are generated (ignored as a corrupted packet) 2 crc error and bit stuffing errors an nrdy interrupt is generated to set the crce bit in both cases when the host controller function is selected and the function controller function is selected. 3 maximum packet size exceeded error a bemp interrupt is generated to set the pid bits to stall in both cases when the host controller function is selected and the function controller function is selected.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 814 of 1262 rej09b0437-0100 (2) data-pid this module does not support high bandwidth transfers. when the function controller function is selected, this module operates as follo ws in response to the received pid. (a) in direction ? data0: sent as data packet pid ? data1: not sent ? data2: not sent ? mdata: not sent (b) out direction (when using full-speed operation) ? data0: received normally as data packet pid ? data1: received normally as data packet pid ? data2: packets are ignored ? mdata: packets are ignored (c) out direction (when using high-speed operation) ? data0: received normally as data packet pid ? data1: received normally as data packet pid ? data2: received normally as data packet pid ? mdata: received normally as data packet pid
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 815 of 1262 rej09b0437-0100 (3) interval counter the isochronous interval can be set using the iitv bits in pipeperi. the interval counter enables the functions shown in table 17.30 when the function controller function is selected. when the host controller function is selected, this module generates the token issuance timing. when the host controller function is selected, the interval counter operation is the same as the interrupt transfer op eration. table 17.30 functions of the in terval counter when the func tion controller function is selected transfer direction function conditions for detection in in buffer flush function when an in token cannot be normally received in the interval frame during an isochronous in transfer out notifies that a token not being received when an out token cannot be normally received in the interval frame during an isochronous out transfer the interval count is carried out when an sof is received or for inte rpolated sofs, so the isochronism can be maintained even if an sof is damaged. the frame interval that can be set is the 2 iitv frame or 2 iitv frames. (a) counter initialization when the functi on controller function is selected this module initializes the interval counter under the following conditions. (i) power-on reset the iitv bit is initialized. (ii) buffer memory initialization using the aclrm bit the iitv bits are not initialized but the count value is. setting the aclrm bit to 0 starts counting from the value set in the iitv bits. after the interval counter has been initialized, the counter is started under the following conditions 1 or 2 when a packet has been transferred normally. 1. an sof is received following transmission of data in response to an in token, in the pid = buf state. 2. an sof is received after data following an out token is received in the pid = buf state.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 816 of 1262 rej09b0437-0100 the interval counter is not initialized under the conditions noted below. 1. when the pid bit is set to nak or stall the interval timer does not stop. this module attempts the transactio ns at the subsequent interval. 2. the usb bus reset or the usb is suspended the iitv bit is not initialized. when the sof has been received, the counter is restarted from the value prior to the reception of the sof. (b) interval counting and transfer control when the host controller f unction is selected this module controls the interval between token issuance operations based on the iitv bit settings. specifically, this module issues a to ken for a selected pipe once every 2iitv ( ) frames. this module counts the interval every 1-ms frame for the pipes used for communications with the full-speed or low-speed peripheral devices connected to a high-speed hub. this module starts counting the token issuance interval at the ( ) frame following the ( ) frame in which software has set the pid bits to buf. interval counter started usb bus pid bit setting token issued to k e n token issued token not issued token not issued nak s o f s o f s o f s o f buf buf buf d a t a 0 o u t d a t a 0 o u t figure 17.12 token issuance when iitv = 0
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 817 of 1262 rej09b0437-0100 interval counter started usb bus pid bit setting nak s o f s o f s o f s o f s o f s o f s o f buf buf buf buf buf buf d a t a 0 d a t a 0 d a t a 0 o u t o u t o u t token not issued token not issued token not issued token not issued to k e n token issued token issued token issued figure 17.13 token issuance when iitv = 1 when the selected pipe is for isochronous transfer s, this module carries out the operation below in addition to controlling token issuance interval. this module issues a token even when the nrdy interrupt generation condition is satisfied. (i) when the selected pipe is for isochronous in transfers this module generates the nrdy interrupt when this module issues the in token but does not receive a packet successfully from a peripher al device (no response or packet error). this module sets the ovrn bit to 1 generating the nrdy interrupt when the time to issue an in token comes in a state in which this module cannot receive data because th e fifo buffer is full (due to the fact that software (dmac) is too slow to read data from the fifo buffer), (ii) when the selected pipe is for isochronous out transfers this module sets the ovrn bit to 1 generating th e nrdy interrupt and tran smitting a zero-length packet when the time to issue an out token comes in a state in which there is no data to be transmitted in the fifo bu ffer (because software (dmac) is to o slow to write data to the fifo buffer). the token issuance interval is reset on any of the following conditions. ? when a hardware-reset is applied to this module (here, the iitv bits are also cleared to 0). ? when software sets the aclrm bit to 1.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 818 of 1262 rej09b0437-0100 (c) interval counting and transfer control wh en the function controller function is selected (i) when the selected pipe is for isochronous out transfers this module generates the nrdy interrupt when this module fails to receive a data packet within the interval set by the iitv bits in terms of ( ) frames. this module generates the nrdy interrupt when this module fails to receive a data packet because of a crc error or other errors containe d in the packet, or becau se of the fifo buffer being full. this module generates the nrdy interrupt on receivi ng an sof packet. even if the sof packet is corrupted, the internal interpolation is used and allows the interrupt to be generated at the timing to receive the sof packet. however, when the iitv bits are set to the value other than 0, this module generates the nrdy interrupt on receiving an sof packet for every inte rval after starting interv al counting operation. when the pid bits are set to nak by software af ter starting the interval timer, this module does not generate the nrdy interrupt on receiving an sof packet. the interval counting starts at the different timing depending on the iitv bit setting as follows. ? when iitv = 0: the interval counting starts at the ( ) frame following the ( ) frame in which software has set the pid bits for the selected pipe to buf. interval counter started ( ) frame pid bit setting nak s o f s o f s o f s o f buf buf buf d a t a 0 o u t d a t a 0 o u t token reception is waited token reception is waited token reception is not waited token reception is not waited to k e n figure 17.14 relationship between ( ) frames and expected token reception when iitv = 0 ? when iitv 0: the interval counting starts on co mpletion of successful reception of the first data packet after the pid bits for the selected pipe have been modified to buf.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 819 of 1262 rej09b0437-0100 interval counter started ( ) frame pid bit setting nak s o f s o f s o f s o f s o f s o f s o f buf buf buf buf buf buf token reception is waited token reception is waited d a t a 0 d a t a 0 d a t a 0 o u t o u t o u t token reception is waited token reception is not waited token reception is not waited token reception is not waited token reception is not waited to k e n figure 17.15 relationship between ( ) frames and expected token reception when iitv 0 (ii) when the selected pipe is for isochronous in transfers the ifis bit should be 1 for this use. when ifis = 0, this module transmits a data packet in response to the received in token irre spective of the iitv bit setting. when ifis = 1, this module clears the fifo buffer when this module fails to receive an in token within the interval set by the iitv bits in terms of ( ) frames in a state in wh ich there is data to be transmitted in the fifo buffer. this module also clears the fifo buffer when this module fails to receive an in token successfully because of a bus error such as a crc error contained in the token. this module clears the fifo buffe r on receiving an sof packet. even if the sof packet is corrupted, the internal interpolation is used and allows the fifo buffer to be cleared at the timing to receive the sof packet. the interval counting starts at the different timing depending on the iitv bit setting (similar to the timing during out transfers). the interval is counted on any of the following conditions in function controller mode. ? when a hardware-reset is applied to this modul e (here, the iitv bits are also cleared to 0). ? when software sets the aclrm bit to 1. ? when this module detects a usb reset.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 820 of 1262 rej09b0437-0100 (4) setup of data to be transmitted using isochronous transfer when the function controller function is selected with isochronous data transmission using this module in function controller function, after data has been written to the buffer memory, a data packet can be sent with the next frame in which an sof packet is detected. this function is called th e isochronous transfer transmission data setup function, and it makes it possible to designate the frame from which transmission began. if a double buffer is used for the buffer memory, transmission will be enabled for only one of the two buffers even after the writing of data to both buffers has been completed, that buffer memory being the one to which the data writing was complete d first. for this reason, even if multiple in tokens are received, the only buffer memory that can be sent is one packet's worth of data. when an in token is received, if the buffer memo ry is in the transmission enabled state, this module transmits the data. if the buffer memory is not in the transmission enabled state, however, a zero-length packet is sent and an underrun error occurs. figure 17.16 shows an example of transmission using the isochronous transfer transmission data setup function with this module, when iitv = 0 (every frame) has been set. sending of a zero- length packet is displayed in the figure as null, in a shaded box.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 821 of 1262 rej09b0437-0100 null null data-a null data-b data-a null null data-b data-a in in in in in in in in in in empty received token sent packet buffer a buffer b received token sent packet buffer a buffer b received token sent packet buffer a buffer b empty empty empty empty transfer enabled writing ended transfer enabled writing ended writing ended writing writing empty empty empty empty writing ended writing ended writing ended writing writing writing writing transfer enabled transfer enabled empty empty empty empty writing ended writing ended writing ended writing writing writing transfer enabled transfer enabled sof packet buffer a buffer b figure17.16 example of data setup function operation (5) isochronous transfer transmission buffe r flush when the function controller function is selected if an sof packet or a sof packet is received with out receiving an in toke n in the interval frame during isochronous data transmission, this module operates as if an in token had been corrupted, and clears the buffer for which transmission is enab led, putting that buffer in the writing enabled state. if a double buffer is being used and writing to both buffers has been completed, the buffer memory that was cleared is seen as the data havi ng been sent at the same interval frame, and transmission is enabled for the buffer me mory that is not discarded with sof or sof packets reception. the timing at which the operation of the buffer flush function varies depending on the value set for the iitv bit.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 822 of 1262 rej09b0437-0100 (a) if iitv = 0 the buffer flush operation starts from the next frame after the pipe becomes valid. (b) in any cases other than iitv = 0 the buffer flush operation is carried out subsequent to the first normal transaction. figure 17.17 shows an example of the buffer flush function of this module. when an unanticipated token is received prior to the interval frame, this module sends the written data or a zero-length packet according to the buffer state. buffer a buffer b empty empty empty writing ended writing ended writing ended writing writing writing transfer enabled transfer enabled figure 17.17 example of buffer flush function operation figure 17.18 shows an example of this module generating an interval error. there are five types of interval errors, as shown below. the interval error is generated at the timing indicated by (1) in the figure, and the in buffer flush function is activated. if an interval error occurs during an in transfers, the buffer flush function is activated; and if it occurs during an out transfer, an nrdy interrupt is generated. the ovrn bit should be used to distinguish between nrdy interr upts such as received packet errors and overrun errors. in response to tokens that are shaded in the figure, responses occur based on the buffer memory status. 1. in direction: ? if the buffer is in the transmission enabled st ate, the data is tran sferred as a normal response. ? if the buffer is in the transmission disabled state, a zero-length packet is sent and an underrun error occurs. 2. out direction: ? if the buffer is in the reception enabled state, the data is received as a normal response. ? if the buffer is in the reception disabled state, the data is discarded and an overrun error occurs.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 823 of 1262 rej09b0437-0100 token corrupted packet inserted frame misaligned frame misaligned token delayed token token to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n to k e n 1 11 1 1 1 1 normal transfer sof figure 17.18 example of an interval error being generated when iitv = 1 17.4.9 sof interpolation function when the function controller function is selected and if data could no t be received at intervals of 1 ms (when using full-speed operation) or 125 s (when using high-speed operation) because an sof packet was corrupted or missing, this module interpolates the sof. the sof interpolation operation begins when the usbe and scke bits in syscfg have been set to 1 and an sof packet is received. the interp olation function is initialized under the following conditions. ? power-on reset ? usb bus reset ? suspended state detected also, the sof interpolation operates under the followi ng specifications. ? 125 s/1 ms conforms to the results of the reset handshake protocol. ? the interpolation function is not activat ed until an sof packet is received. ? after the first sof packet is received, either 125 s or 1 ms is counted with an internal clock of 48 mhz, and interpolation is carried out. ? after the second and subsequent sof packets are received, interpolation is carried out at the previous reception interval. ? interpolation is not carried out in the suspended state or while a usb bus reset is being received. (with suspended transiti ons in high-speed ope ration, interpolation continues for 3 ms after the last packet is received.) this module supports the following functions based on the sof detection. these functions also operate normally with sof interpolation, if the sof packet was corrupted. ? refreshing of the frame number and the micro-frame number ? sofr interrupt timing and sof lock ? isochronous transfer interval count
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 824 of 1262 rej09b0437-0100 if an sof packet is missing when full-speed operation is being used, the frnm bit in frmnum0 is not refreshed. if a sof packet is missing during high-speed operation, the ufrnm bit in frmnum1 is refreshed. however, if a sof packet for which the frnm = 000 is missing, the frnm bit is not refreshed. in this case, the frnm b it is not refreshed even if successive sof packets other than frnm = 000 are received normally. 17.4.10 pipe schedule (1) conditions for generating a transaction when the host controller function is selected and uact has been set to 1, this module generates a transaction under the conditions noted in table 17.31. table 17.31 conditions for generating a transaction conditions for generation transaction dir pid iitv0 buffer state sureq setup ? * 1 ? * 1 ? * 1 ? * 1 1 setting in buf invalid receive area exists ? * 1 control transfer data stage, status stage, bulk transfer out buf invalid send data exists ? * 1 in buf valid receive area exists ? * 1 interrupt transfer out buf valid send data exists ? * 1 in buf valid * 2 ? * 1 isochronous transfer out buf valid * 3 ? * 1 notes: 1. symbols ( ? ) in the table indicate that the condi tion is one that is unrelated to the generating of tokens. "valid" indicates t hat, for interrupt transfers and isochronous transfers, the condition is generated only in transfer frames that are based on the interval counter. "invalid" indicates that the condition is generated regardless of the interval counter. 2. this indicates that a transaction is gener ated regardless of whether or not there is a receive area. if there was no receive area, however, the received data is destroyed. 3. this indicates that a transaction is generat ed regardless of whether or not there is any data to be sent. if there was no data to be sent, however, a zero-length packet is sent.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 825 of 1262 rej09b0437-0100 (2) transfer schedule this section describes the transfer scheduling w ithin a frame of this module. after the module sends an sof, the transfer is carried out in the sequence described below. (a) execution of periodic transfers a pipe is searched in the order of pipe 1 pipe 2 pipe 6 pipe 7 pipe 8 pipe 9, and then, if the pipe is one for which an isochronous or interrupt transfer transaction can be generated, the transaction is generated. (b) setup transactions for control transfers the dcp is checked, and if a setup tr ansaction is possible, it is sent. (c) execution of bulk and control transf er data stages and status stages a pipe is searched in the order of dcp pipe 1 pipe 2 pipe 3 pipe 4 pipe 5, and then, if the pipe is one for which a bulk or control transfer data stage or a control transfer status stage transaction can be generated, the transaction is generated. if a transfer is generated, processing moves to the next pipe transaction regardless of whether the response from the peripheral device is ack or nak. also, if there is time for the transfer to be done within the frame, step 3 is repeated. (3) usb communication enabled setting the uact bit of the dvstctr register to 1 initiates sending of an sof or sof, and makes it possible to generate a transaction. setting the uact bit to 0 stops the sending of the sof or sof and initiates a suspend state. if the setting of the uact bit is changed from 1 to 0, processing stops after the next sof or sof is sent.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 826 of 1262 rej09b0437-0100 17.5 usage notes 17.5.1 power supplies for the usb module the power supply for the usb module must be turned on and off simultaneously with the other power supplies. an example of the usb peripheral circuit that is used as the usb function is shown in figure 17.19. vbus 100 5.6k 1uf dm 1 2 3 4 dp vbus gnd usb b receptable d ? d + refrin this lsi : to dg33 : to ag33 note : figure 17.19 example of usb external circu it when usb power supply is continuously supplied the example of the usb external ci rcuit when usb module is used as a host is shown in figure 17.20. the circuit to control 5 v power supply by using the port etc. is required though the detection of vbus connection/disconnec tion is unnecessary for the usb host.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 827 of 1262 rej09b0437-0100 vbus 100 5.6k 1.0uf dm dp vbus usb a receptable d- d+ refrin this lsi port 3.3v 5v 120uf 0.1uf port fault sel out on out gnd gnd in in max1946 1uf 100k : to dg33 : to ag33 note : figure 17.20 example of usb external ci rcuit when usb module is used as host
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 828 of 1262 rej09b0437-0100 (1) power-on procedure for usb module turn on the power supply for the usb module by a procedure listed below for the circuit shown in figure 17.20 that detects the usb bus connection with the irqn pin. 1. set the register to generate the interrupt by the rising edge or the high level detection of the irqn pin. 2. when vbus becomes high level by connecting usb connector to the usb host, the irqn interrupt is generated. 3. turn on the 1.2v-system power supply for the usb module. turn on the 3.3v-system power supply for the usb module after the 1.2v-sys tem power supply voltage has reached 1.2v. 4. return the usb module to the normal opera tion state if usb module has been in a module stop state. 5. if the ucks bit of usbexr and the usben bit of uclkcr are both 0, set usben bit to 1 and wait until the usb clock is steady. 6. clear the pde bit of usbexr to 0 after the power supply voltages for the usb module have reached valid operating levels. 7. set dvs[1:0] bit of usbexr to specify th e multiplication factor of an usb on-chip pll, after the power supply voltages for the usb module reach valid operating levels and the usb clock oscillation is steady. for instance, set b '10 when the usb clock frequency is 48mhz. wait until an usb on-chip pll stabilizes after setting the multiplication factor. 8. set the cke bit of usbexr to 1 to start the clock signal supply after the usb on-chip pll has stabilized. 9. clear the rst bit of usbexr to 0 to cancel the reset state af ter the clock signal supply has started. start the usb module setting after th e reset state has been canceled. the vbus detection interrupt is enabled from this time.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 829 of 1262 rej09b0437-0100 (2) power-off procedure for usb module turn off the power supplies for the usb module by a procedure listed below. 1. set the usb communication off state with disabling the pull-up of the dp pin before turning off the power supply of the usb module. 2. clear the cke bit of usbexr to 0 and set both rst bit and pde bit to 1. ? the current consumption can be reduced by the following two methods. ? put the usb module to the module stop state. ? clear the usben bit of uclkcr to 0. however, it takes long time to the start of the usb module in this case. 3. turn off the power supplies for the usb module with the order that is turning off 1.2v-system power supply after turning off 3.3v-system power supply.
section 17 usb 2.0 host/function module (usb) rev. 1.00 nov. 14, 2007 page 830 of 1262 rej09b0437-0100 17.5.2 dtch interrupt if the usb is disconnected in the host controller mode, the dtch interrupt may be delayed for 5msec at the maximum, during which time, the nrdy interrupt may be generated.
section 18 sd host interface (sdhi) rev. 1.00 nov. 14, 2007 page 831 of 1262 rej09b0437-0100 section 18 sd host interface (sdhi) renesas technology corporation is only able to provide information contained in this section to parties with which we have concluded a nondisclosure agreement. please contact one of our sales representatives for details.
section 18 sd host interface (sdhi) rev. 1.00 nov. 14, 2007 page 832 of 1262 rej09b0437-0100
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 833 of 1262 rej09b0437-0100 section 19 i 2 c bus interface 3 (iic3) the i 2 c bus interface 3 conforms to and pr ovides a subset of the philips i 2 c (inter-ic) bus interface functions. however, the configuration of the re gisters that control the i 2 c bus differs partly from the philips re gister configuration. the i 2 c bus interface 3 has one channel. 19.1 features ? selection of i 2 c format or clocked synchronous serial format ? continuous transmission/reception since the shift register, transmit data register, and receive data register are independent from each other, the continuous transmi ssion/reception can be performed. i 2 c bus format: ? start and stop conditions generated automatically in master mode ? selection of acknowledge output levels when receiving ? automatic loading of acknowledge bit when transmitting ? bit synchronization function in master mode, the state of scl is monitored per bit, and the timing is synchronized automatically. if transmission/ reception is not yet possible, set the scl to low until preparations are completed. ? six interrupt sources transmit data empty (including slave-address matc h), transmit end, receive data full (including slave-address match), arbitration lost, nack detection, and stop condition detection ? the direct memory access controller (dmac) can be activated by a transmit-data-empty request or receive-data-full request to transfer data. ? direct bus drive two pins, scl and sda pins, function as nmos open-drain outputs when the bus drive function is selected. clocked synchronous serial format: ? four interrupt sources transmit-data-empty, transmit-end, receive-data-full, and overrun error ? the direct memory access controller (dmac) can be activated by a transmit-data-empty request or receive-data-full request to transfer data.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 834 of 1262 rej09b0437-0100 figure 19.1 shows a block diagram of the i 2 c bus interface 3. scl iccr1 iccr2 icmr icsr icier icdrr icdrs icdrt sar sda nf2cyc transfer clock generation circuit address comparator interrupt generator interrupt request bus state decision circuit arbitration decision circuit noise canceler noise filter output control output control transmission/ reception control circuit i 2 c bus control register 1 i 2 c bus control register 2 i 2 c bus mode register i 2 c bus status register i 2 c bus interrupt enable register i 2 c bus transmit data register i 2 c bus receive data register i 2 c bus shift register slave address register nf2cyc register [legend] iccr1: iccr2: icmr: icsr: icier: icdrt: icdrr: icdrs: sar: nf2cyc: peripheral bus figure 19.1 block diagram of i 2 c bus interface 3
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 835 of 1262 rej09b0437-0100 19.2 input/output pins table 19.1 shows the pin configuration of the i 2 c bus interface 3. table 19.1 pin configuration pin name symbol i/o function serial clock scl i/o i 2 c serial clock input/output serial data sda i/o i 2 c serial data input/output figure 19.2 shows an example of i/o pin connections to external circuits. pvcc * pvcc * scl in scl out scl sda in sda out sda scl sda scl in scl out scl sda in sda out sda scl in scl out scl sda in sda out sda note: * turn on/off pvcc for the i 2 c bus power supply and for this lsi simultaneously. (master) (slave 1) (slave 2) figure 19.2 external circu it connections of i/o pins
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 836 of 1262 rej09b0437-0100 19.3 register descriptions the i 2 c bus interface 3 has the following registers. table 19.2 register configuration channel register name abbreviation r/w initial value address access size i 2 c bus control register 1 iccr1_0 r/w h'00 h'fffee000 8 i 2 c bus control register 2 i ccr2_0 r/w h'7d h'fffee001 8 i 2 c bus mode register icmr_0 r/w h'38 h'fffee002 8 i 2 c bus interrupt enable register icier_0 r/w h'00 h'fffee003 8 i 2 c bus status register icsr_0 r/w h'00 h'fffee004 8 slave address register sar_0 r/w h'00 h'fffee005 8 i 2 c bus transmit data register icdrt_0 r/w h'ff h'fffee006 8 i 2 c bus receive data register icdrr_0 r/w h'ff h'fffee007 8 0 nf2cyc register nf2cyc_0 r/w h'00 h'fffee008 8 19.3.1 i 2 c bus control register 1 (iccr1) iccr1 is an 8-bit readable/writable register that enables or disables the i 2 c bus interface 3, controls transmission or reception, and selects ma ster or slave mode, transmission or reception, and transfer clock frequency in master mode. 7654321 0 00000000 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: ice rcvd mst trs cks[3:0]
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 837 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 ice 0 r/w i 2 c bus interface 3 enable 0: this module is halted. (scl and sda pins function as ports.) 1: this bit is enabled for transfer operations. (scl and sda pins are bus drive state.) 6 rcvd 0 r/w reception disable enables or disables the next operation when trs is 0 and icdrr is read. 0: enables next reception 1: disables next reception 5 4 mst trs 0 0 r/w r/w master/slave select transmit/receive select in master mode with the i 2 c bus format, when arbitration is lost, mst and trs are both reset by hardware, causing a transition to slave receive mode. modification of the trs bit should be made between transfer frames. when seven bits after the start condition is issued in slave receive mode match the slave address set to sar and the 8th bit is set to 1, trs is automatically set to 1. if an overrun erro r occurs in master receive mode with the clocked synchronous serial format, mst is cleared and the mode changes to slave receive mode. operating modes are described below according to mst and trs combination. when clocked synchronous serial format is selected and mst = 1, clock is output. 00: slave receive mode 01: slave transmit mode 10: master receive mode 11: master transmit mode 3 to 0 cks[3:0] 0000 r/w transfer clock select these bits should be set according to the necessary transfer rate (table 19.3) in master mode.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 838 of 1262 rej09b0437-0100 table 19.3 transfer rate bit 3 bit 2 bit 1 bit 0 transfer rate (khz) cks3 cks2 cks1 cks0 clock p = 16.7 mhz p = 20.0 mhz p = 25.0 mhz p = 26.7 mhz p = 33.3 mhz 0 0 0 0 p /44 379 khz 455 khz 568 khz 606 khz 758 khz 1 p /52 321 khz 385 khz 481 khz 513 khz 641 khz 1 0 p /64 260 khz 313 khz 391 khz 417 khz 521 khz 1 p /72 231 khz 278 khz 347 khz 370 khz 463 khz 1 0 0 p /84 198 khz 238 khz 298 khz 317 khz 397 khz 1 p /92 181 khz 217 khz 272 khz 290 khz 362 khz 1 0 p /100 167 khz 200 khz 250 khz 267 khz 333 khz 1 p /108 154 khz 185 khz 231 khz 247 khz 309 khz 1 0 0 0 p /176 94.7 khz 114 khz 142 khz 152 khz 189 khz 1 p /208 80.1 khz 96.2 khz 120 khz 128 khz 160 khz 1 0 p /256 65.1 khz 78.1 khz 97.7 khz 104 khz 130 khz 1 p /288 57.9 khz 69.4 khz 86.8 khz 92.6 khz 116 khz 1 0 0 p /336 49.6 khz 59.5 khz 74.4 khz 79.4 khz 99.2 khz 1 p /368 45.3 khz 54.3 khz 67.9 khz 72.5 khz 90.6 khz 1 0 p /400 41.7 khz 50.0 khz 62.5 khz 66.7 khz 83.3 khz 1 p /432 38.6 khz 46.3 khz 57.9 khz 61.7 khz 77.2 khz note: the settings should satisfy external specifications.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 839 of 1262 rej09b0437-0100 19.3.2 i 2 c bus control register 2 (iccr2) iccr2 is an 8-bit readable/writable register that issues start/stop conditions, manipulates the sda pin, monitors the scl pin, and controls reset in the control part of the i 2 c bus. 7654321 0 01111101 r/w r/w r/w r/w r r r/w r bit: initial value: r/w: bbsy scp sdao sdaop sclo - iicrst - bit bit name initial value r/w description 7 bbsy 0 r/w bus busy enables to confirm whether the i 2 c bus is occupied or released and to issue start/stop conditions in master mode. with the clocked synchronous serial format, this bit is always read as 0. with the i 2 c bus format, this bit is set to 1 when the sda level changes from high to low under the condition of scl = high, assuming that the start condition has been issued. this bit is cleared to 0 when the sda level changes from low to high under the condition of scl = high, assuming that the stop condition has been issued. write 1 to bbsy and 0 to scp to issue a start condition. follow this procedure when also re-transmitting a start condition. write 0 in bbsy and 0 in scp to issue a stop condition. 6 scp 1 r/w start/stop issue condition disable controls the issue of start/s top conditions in master mode. to issue a start condition, write 1 in bbsy and 0 in scp. a retransmit start condition is issued in the same way. to issue a stop condition, write 0 in bbsy and 0 in scp. this bit is always read as 1. even if 1 is written to this bit, the data will not be stored.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 840 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 sdao 1 r/w sda output value control this bit is used with sdaop when modifying output level of sda. this bit should not be manipulated during transfer. 0: when reading, sda pin outputs low. when writing, sda pin is changed to output low. 1: when reading, sda pin outputs high. when writing, sda pin is changed to output hi-z (outputs high by external pull-up resistance). 4 sdaop 1 r/w sdao write protect controls change of output level of the sda pin by modifying the sdao bit. to change the output level, clear sdao and sdaop to 0 or set sdao to 1 and clear sdaop to 0. this bit is always read as 1. 3 sclo 1 r scl output level monitors scl output level. when sclo is 1, scl pin outputs high. when sclo is 0, scl pin outputs low. 2 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 1 iicrst 0 r/w iic control part reset resets the control part except for i 2 c registers. if this bit is set to 1 when hang-up occurs because of communication failure during i 2 c bus operation, some iic3 registers and the control part can be reset. 0 ? 1 r reserved this bit is always read as 1. the write value should always be 1.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 841 of 1262 rej09b0437-0100 19.3.3 i 2 c bus mode register (icmr) icmr is an 8-bit readable/writable register that selects whether the msb or lsb is transferred first, performs master mode wait control, and selects the transfer bit count. bits bc[2:0] are initialized to h'0 by the iicrst bit in iccr2. 7654321 0 00111000 r/w r r r r/w r/w r/w r/w bit: initial value: r/w: mls --- bcwp bc[2:0] bit bit name initial value r/w description 7 mls 0 r/w msb-first/lsb-first select 0: msb-first 1: lsb-first set this bit to 0 when the i 2 c bus format is used. 6 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 5, 4 ? all 1 r reserved these bits are always read as 1. the write value should always be 1. 3 bcwp 1 r/w bc write protect controls the bc[2:0] modifications. when modifying the bc[2:0] bits, this bit should be cleared to 0. in clocked synchronous serial mode, the bc[2:0] bits should not be modified. 0: when writing, values of the bc[2:0] bits are set. 1: when reading, 1 is always read. when writing, settings of the bc[2:0] bits are invalid.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 842 of 1262 rej09b0437-0100 bit bit name initial value r/w description bit counter these bits specify the number of bits to be transferred next. when read, the remaining number of transfer bits is indicated. with the i 2 c bus format, the data is transferred with one addition acknowledge bit. should be made between transfer frames. if these bits are set to a value other than b'000, the setting should be made while the scl pin is low. the value returns to b'000 at the end of a data transfer, including the acknowledge bit. these bits automatically return to b'111 after a stop condition is detected. these bits are cleared by a power-on reset and in software standby mode and module standby mode. these bits are also cleared by setting the iicrst bit of iccr2 to 1. with the clocked synchronous serial format, these bits should not be modified. 2 to 0 bc[2:0] 000 r/w i 2 c bus format 000: 9 bits 001: 2 bits 010: 3 bits 011: 4 bits 100: 5 bits 101: 6 bits 110: 7 bits 111: 8 bits clocked synchronous serial format 000: 8 bits 001: 1 bit 010: 2 bits 011: 3 bits 100: 4 bits 101: 5 bits 110: 6 bits 111: 7 bits
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 843 of 1262 rej09b0437-0100 19.3.4 i 2 c bus interrupt enable register (icier) icier is an 8-bit readable/writable register that enables or disables interrupt sources and acknowledge bits, sets acknowledge bits to be transferred, and confirms acknowledge bits received. 7654321 0 00000000 r/w r/w r/w r/w r/w r/w r r/w bit: initial value: r/w: tie teie rie nakie stie acke ackbr ackbt bit bit name initial value r/w description 7 tie 0 r/w transmit interrupt enable when the tdre bit in icsr is set to 1 or 0, this bit enables or disables the transmit data empty interrupt (txi). 0: transmit data empty interrupt request (txi) is disabled. 1: transmit data empty interrupt request (txi) is enabled. 6 teie 0 r/w transmit end interrupt enable enables or disables the transmit end interrupt (tei) at the rising of the ninth clock while the tdre bit in icsr is 1. tei can be canceled by clearing the tend bit or the teie bit to 0. 0: transmit end interrupt request (tei) is disabled. 1: transmit end interrupt request (tei) is enabled. 5 rie 0 r/w receive interrupt enable enables or disables the receive data full interrupt request (rxi) and the overrun error interrupt request (eri) in the clocked synchronous format when receive data is transferred from icdrs to icdrr and the rdrf bit in icsr is set to 1. rxi can be canceled by clearing the rdrf or rie bit to 0. 0: receive data full interrupt request (rxi) are disabled. 1: receive data full interrupt request (rxi) are enabled.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 844 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 nakie 0 r/w nack receive interrupt enable enables or disables the nack detection interrupt request (naki) and the overrun error (ove set in icsr) interrupt request (eri) in the clocked synchronous format when the nackf or al/ove bit in icsr is set. naki can be canceled by clearing the nackf, al/ove, or nakie bit to 0. 0: nack receive interrupt request (naki) is disabled. 1: nack receive interrupt request (naki) is enabled. 3 stie 0 r/w stop condition detection interrupt enable enables or disables the stop condition detection interrupt request (stpi) when the stop bit in icsr is set. 0: stop condition detection interrupt request (stpi) is disabled. 1: stop condition detection interrupt request (stpi) is enabled. 2 acke 0 r/w acknowledge bit judgment select 0: the value of the receive acknowledge bit is ignored, and continuous transfer is performed. 1: if the receive acknowledge bit is 1, continuous transfer is halted. 1 ackbr 0 r receive acknowledge in transmit mode, this bit stores the acknowledge data that are returned by the receive device. this bit cannot be modified. this bit can be canceled by setting the bbsy bit in iccr2 to 1. 0: receive acknowledge = 0 1: receive acknowledge = 1 0 ackbt 0 r/w transmit acknowledge in receive mode, this bit spec ifies the bit to be sent at the acknowledge timing. 0: 0 is sent at the acknowledge timing. 1: 1 is sent at the acknowledge timing.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 845 of 1262 rej09b0437-0100 19.3.5 i 2 c bus status register (icsr) icsr is an 8-bit readable/writable register that confirms interrupt request flags and their status. 7654321 0 00000000 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: tdre tend rdrf nackf stop al/ove aas adz bit bit name initial value r/w description 7 tdre 0 r/w transmit data register empty [clearing conditions] ? when 0 is written in tdre after reading tdre = 1 ? when data is written to icdrt [setting conditions] ? when data is transferred from icdrt to icdrs and icdrt becomes empty ? when trs is set ? when the start condition (including retransmission) is issued ? when slave mode is changed from receive mode to transmit mode 6 tend 0 r/w transmit end [clearing conditions] ? when 0 is written in tend after reading tend = 1 ? when data is written to icdrt [setting conditions] ? when the ninth clock of scl rises with the i 2 c bus format while the tdre flag is 1 ? when the final bit of transmit frame is sent with the clocked synchronous serial format
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 846 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 rdrf 0 r/w receive data full [clearing conditions] ? when 0 is written in rdrf after reading rdrf = 1 ? when icdrr is read [setting condition] ? when a receive data is transferred from icdrs to icdrr 4 nackf 0 r/w no acknowledge detection flag [clearing condition] ? when 0 is written in nackf after reading nackf = 1 [setting condition] ? when no acknowledge is detected from the receive device in transmission while the acke bit in icier is 1 3 stop 0 r/w stop condition detection flag [clearing condition] ? when 0 is written in stop after reading stop = 1 [setting conditions] ? when a stop condition is detected after frame transfer is completed
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 847 of 1262 rej09b0437-0100 bit bit name initial value r/w description 2 al/ove 0 r/w arbitration lost flag/overrun error flag indicates that arbitration wa s lost in master mode with the i 2 c bus format and that the final bit has been received while rdrf = 1 with the clocked synchronous format. when two or more master devices attempt to seize the bus at nearly the same time, if the i 2 c bus interface 3 detects data differing from the data it sent, it sets al to 1 to indicate that the bus has been occupied by another master. [clearing condition] ? when 0 is written in al/ove after reading al/ove = 1 [setting conditions] ? if the internal sda and sda pin disagree at the rise of scl in master transmit mode ? when the sda pin outputs high in master mode while a start condition is detected ? when the final bit is received with the clocked synchronous format while rdrf = 1 1 aas 0 r/w slave addr ess recognition flag in slave receive mode, this flag is set to 1 if the first frame following a start condition matches bits sva[6:0] in sar. [clearing condition] ? when 0 is written in aas after reading aas = 1 [setting conditions] ? when the slave address is detected in slave receive mode ? when the general call address is detected in slave receive mode. 0 adz 0 r/w general call address recognition flag this bit is valid in slave receive mode with the i 2 c bus format. [clearing condition] ? when 0 is written in adz after reading adz = 1 [setting condition] ? when the general call address is detected in slave receive mode
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 848 of 1262 rej09b0437-0100 19.3.6 slave address register (sar) sar is an 8-bit readable/writable register that selects the communications format and sets the slave address. in slave mode with the i 2 c bus format, if the upper seven bits of sar match the upper seven bits of the first frame received after a start condition, this modul e operates as the slave device. 7654321 0 00000000 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: sva[6:0] fs bit bit name initial value r/w description 7 to 1 sva[6:0] 000000 0 r/w slave address these bits set a unique address in these bits, differing form the addresses of other slave devices connected to the i 2 c bus. 0 fs 0 r/w format select 0: i 2 c bus format is selected 1: clocked synchronous se rial format is selected 19.3.7 i 2 c bus transmit data register (icdrt) icdrt is an 8-bit readable/writable register that stores the transmit data. when icdrt detects the space in the shift register (icdrs), it transfers th e transmit data which is written in icdrt to icdrs and starts transferring data. if the next transfer data is written to icdrt while transferring data of icdrs, continuous transfer is possible. 7654321 0 11111111 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w:
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 849 of 1262 rej09b0437-0100 19.3.8 i 2 c bus receive data register (icdrr) icdrr is an 8-bit register that stores the receiv e data. when data of one byte is received, icdrr transfers the receive data from icdrs to icdrr and the next data can be received. icdrr is a receive-only register, therefore the cp u cannot write to this register. 7654321 0 11111111 rrrrrrrr bit: initial value: r/w: 19.3.9 i 2 c bus shift register (icdrs) icdrs is a register that is used to transfer/receive data. in transm ission, data is transferred from icdrt to icdrs and the data is sent from the sda pin. in reception, data is transferred from icdrs to icdrr after data of one byte is received. this register cannot be read directly from the cpu. 7654321 0 -------- -------- bit: initial value: r/w:
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 850 of 1262 rej09b0437-0100 19.3.10 nf2cyc register (nf2cyc) nf2cyc is an 8-bit readable/writable register that selects the range of the noise filtering for the scl and sda pins. for details of the noise filter, see section 19.4.7, noise filter. 7654321 0 00000000 rrrrrrr/wr/w bit: initial value: r/w: ------prs nf2 cyc bit bit name initial value r/w description 7 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 prs 0 r/w pulse width ratio select specifies the ratio of the high-level period to the low- level period for the scl signal. 0: the ratio of high to low is 0.5 to 0.5. 1: the ratio of high to low is about 0.4 to 0.6. 0 nf2cyc 0 r/w noise filtering range select 0: the noise less than one cycle of the peripheral clock can be filtered out 1: the noise less than two cycles of the peripheral clock can be filtered out
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 851 of 1262 rej09b0437-0100 19.4 operation the i 2 c bus interface 3 can communicate either in i 2 c bus mode or clocked synchronous serial mode by setting fs in sar. 19.4.1 i 2 c bus format figure 19.3 shows the i 2 c bus formats. figure 19.4 shows the i 2 c bus timing. the first frame following a start condition always consists of eight bits. sa sla 7n r/ w data a 1 1m 11 1 a/ a 1 p 1 s sla 7n1 7 r/ w a data 11 1m1 1 a/ a 1 s 1 sla r/ w 1 1m2 a 1 data n2 a/ a 1 p 1 (a) i 2 c bus format (fs = 0) (b) i 2 c bus format (start condition retransmission, fs = 0) n: transfer bit count (n = 1 to 8) m: transfer frame count (m 1) n1 and n2: transfer bit count (n1 and n2 = 1 to 8) m1 and m2: transfer frame count (m1 and m2 1) figure 19.3 i 2 c bus formats sda scl s sla r/ w a 9 8 1-7 9 8 1-7 9 8 1-7 data a data a p figure 19.4 i 2 c bus timing [legend] s: start condition. the master device drives sda from high to low while scl is high. sla: slave address r/ w : indicates the direction of data transfer: fr om the slave device to the master device when r/w is 1, or from the master device to the slave device when r/w is 0. a: acknowledge. the receive device drives sda to low. data: transfer data p: stop condition. the master device drives sda from low to high while scl is high.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 852 of 1262 rej09b0437-0100 19.4.2 master transmit operation in master transmit mode, the master device outputs the transmit clock and transmit data, and the slave device returns an acknowledge signal. for ma ster transmit mode operation timing, refer to figures 19.5 and 19.6. the transmission procedure and operations in master transmit mode are described below. 1. set the ice bit in iccr1 to 1. also, set bits cks[3:0] in iccr1. (initial setting) 2. read the bbsy flag in iccr2 to confirm that the bus is released. set the mst and trs bits in iccr1 to select master transmit mode. then, write 1 to bbsy and 0 to scp. (start condition issued) this generates the start condition. 3. after confirming that tdre in icsr has been set, write the transmit data (the first byte data show the slave address and r/ w ) to icdrt. at this time, tdre is automatically cleared to 0, and data is transferred from icdrt to icdrs. tdre is set again. 4. when transmission of one byte data is comple ted while tdre is 1, tend in icsr is set to 1 at the rise of the 9th transmit clock pulse. read the ackbr bit in icier, and confirm that the slave device has been selected. then, write second byte data to icdrt. when ackbr is 1, the slave device has not been acknowledged, so issue the stop condition. to issue the stop condition, write 0 to bbsy and scp. scl is fixed low until the transmit data is prepared or the stop condition is issued. 5. the transmit data after the second byte is written to icdrt every time tdre is set. 6. write the number of bytes to be transmitted to icdrt. wait until tend is set (the end of last byte data transmission) while tdre is 1, or wait for nack (nackf in icsr = 1) from the receive device while acke in icier is 1. then , issue the stop condition to clear tend or nackf. 7. when the stop bit in icsr is set to 1, the operation returns to the slave receive mode.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 853 of 1262 rej09b0437-0100 tdre tend icdrt icdrs 12 12 3456789 a r/ w scl (master output) sda (master output) sda (slave output) [5] write data to icdrt (third byte) [2] instruction of start condition issuance [3] write data to icdrt (first byte) [4] write data to icdrt (second byte) user processing bit 7 slave address address + r/ w data 1 data 1 data 2 address + r/ w bit 6 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 figure 19.5 master transmit mode operation timing (1) tdre tend icdrt icdrs 1 9 23456789 a a/ a [6] issue stop condition. clear tend. [7] set slave receive mode scl (master output) sda (master output) sda (slave output) bit 7 bit 6 data n data n bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 [5] write data to icdrt user processing figure 19.6 master transmit mode operation timing (2)
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 854 of 1262 rej09b0437-0100 19.4.3 master receive operation in master receive mode, the master device outputs th e receive clock, receives data from the slave device, and returns an acknowledge signal. for master receive mode operation timing, refer to figures 19.7 and 19.8. the reception procedure and operations in master receive mode are shown below. 1. clear the tend bit in icsr to 0, then clear the trs bit in iccr1 to 0 to switch from master transmit mode to master receive mode . then, clear the tdre bit to 0. 2. when icdrr is read (dummy data read), reception is started, and the receive clock is output, and data received, in synchronization with the internal clock. the master device outputs the level specified by ackbt in icier to sda, at the 9th receive clock pulse. 3. after the reception of first frame data is complete d, the rdrf bit in icsr is set to 1 at the rise of 9th receive clock pulse. at this time, the r eceive data is read by reading icdrr, and rdrf is cleared to 0. 4. the continuous reception is performed by reading icdrr every time rdrf is set. if 8th receive clock pulse falls after reading icdrr by the other processing while rdrf is 1, scl is fixed low until icdrr is read. 5. if next frame is the last receive data, set th e rcvd bit in iccr1 to 1 before reading icdrr. this enables the issuance of the stop condition after the next reception. 6. when the rdrf bit is set to 1 at rise of th e 9th receive clock pulse, issue the stage condition. 7. when the stop bit in icsr is set to 1, read icdrr. then clear the rcvd bit to 0. 8. the operation returns to the slave receive mode. note: if only one byte is receive d, read icdrr (dummy-read) afte r the rcvd bit in iccr1 is set.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 855 of 1262 rej09b0437-0100 tdre tend icdrs icdrr 1 a 21 3456789 9 a trs rdrf [1] clear tdre after clearing tend and trs [2] read icdrr (dummy read) [3] read icdrr scl (master output) sda (master output) sda (slave output) bit 7 master transmit mode master receive mode bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 user processing data 1 data 1 figure 19.7 master receive mode operation timing (1) rdrf rcvd icdrs icdrr 1 9 23456789 a a/ a data n-1 data n data n data n-1 [5] read icdrr after setting rcvd [6] issue stop condition [7] read icdrr, and clear rcvd [8] set slave receive mode scl (master output) sda (master output) sda (slave output) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 user processing figure 19.8 master receive mode operation timing (2)
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 856 of 1262 rej09b0437-0100 19.4.4 slave transmit operation in slave transmit mode, the slave device outputs th e transmit data, while the master device outputs the receive clock and returns an acknowledge sign al. for slave transmit mode operation timing, refer to figures 19.9 and 19.10. the transmission procedure and operations in slave transmit mode are described below. 1. set the ice bit in iccr1 to 1. set bits ck s[3:0] in iccr1. (initial setting) set the mst and trs bits in iccr1 to select slave receive m ode, and wait until the slave address matches. 2. when the slave address matches in the first frame following detection of the start condition, the slave device outputs the level specified by ac kbt in icier to sda, at the rise of the 9th clock pulse. at this time, if the 8th bit data (r/w) is 1, the trs bit in iccr1 and the tdre bit in icsr are set to 1, and the mode changes to slave transmit mode automatically. the continuous transmission is performed by writi ng transmit data to icdrt every time tdre is set. 3. if tdre is set after writing last transmit data to icdrt, wait until tend in icsr is set to 1, with tdre = 1. when tend is set, clear tend. 4. clear trs for the end processing, and read icdrr (dummy read). scl is opened. 5. clear tdre.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 857 of 1262 rej09b0437-0100 tdre tend icdrs icdrr 1 a 21 3456789 9 a trs icdrt scl (master output) slave receive mode slave transmit mode sda (master output) sda (slave output) scl (slave output) bit 7 bit 7 data 1 data 1 data 2 data 3 data 2 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 [2] write data to icdrt (data 1) [2] write data to icdrt (data 2) [2] write data to icdrt (data 3) user processing figure 19.9 slave transmit mode operation timing (1)
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 858 of 1262 rej09b0437-0100 tdre tend icdrs icdrr 1 9 2345678 9 trs icdrt a a data n scl (master output) sda (master output) sda (slave output) scl (slave output) bit 7 slave transmit mode slave receive mode bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 [3] clear tend [5] clear tdre [4] read icdrr (dummy read) after clearing trs user processing figure 19.10 slave transmit mode operation timing (2)
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 859 of 1262 rej09b0437-0100 19.4.5 slave receive operation in slave receive mode, the master device outputs the transmit clock and transmit data, and the slave device returns an acknowledge signal. for slave receive mode operation timing, refer to figures 19.11 and 19.12. the reception procedure and operations in slave receive mode are described below. 1. set the ice bit in iccr1 to 1. set bits cks[3:0] in iccr1. (initial setting) set the mst and trs bits in iccr1 to select slave receive m ode, and wait until the slave address matches. 2. when the slave address matches in the first frame following detection of the start condition, the slave device outputs the leve l specified by ackbt in icier to sda, at the rise of the 9th clock pulse. at the same time, rdrf in icsr is set to read icdrr (d ummy read). (since the read data show the slave address and r/w, it is not used.) 3. read icdrr every time rdrf is set. if 8th r eceive clock pulse falls while rdrf is 1, scl is fixed low until icdrr is read. the change of the acknowledge before reading icdrr, to be returned to the master device, is re flected to the next transmit frame. 4. the last byte data is read by reading icdrr. icdrs icdrr 12 1 345678 9 9 a a rdrf data 1 data 2 data 1 scl (master output) sda (master output) sda (slave output) scl (slave output) bit 7 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 [2] read icdrr (dummy read) [2] read icdrr user processing figure 19.11 slave receive mode operation timing (1)
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 860 of 1262 rej09b0437-0100 icdrs icdrr 12345678 9 9 a a rdrf scl (master output) sda (master output) sda (slave output) scl (slave output) user processing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 data 1 [3] set ackbt [3] read icdrr [4] read icdrr data 2 data 1 figure 19.12 slave receive mode operation timing (2) 19.4.6 clocked synchronous serial format this module can be operated with the clocked synchronous serial format, by setting the fs bit in sar to 1. when the mst bit in iccr1 is 1, the transfer clock output from scl is selected. when mst is 0, the external clock input is selected. (1) data transfer format figure 19.13 shows the clocked synchronous serial transfer format. the transfer data is output from the fall to the fa ll of the scl clock, and the data at the rising edge of the scl clock is guaranteed. the mls bit in icmr sets the order of data transfer, in either the msb first or lsb first. the output level of sda can be changed during the transfer wait, by the sdao bit in iccr2. sda scl bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 figure 19.13 clocked synchronous serial transfer format
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 861 of 1262 rej09b0437-0100 (2) transmit operation in transmit mode, transmit data is output from sda, in synchronization with the fall of the transfer clock. the transfer clock is output when mst in iccr1 is 1, and is input when mst is 0. for transmit mode operation timing, refer to figure 19.14. the transmission procedure and operations in transmit mode are described below. 1. set the ice bit in iccr1 to 1. set the mst and cks[3:0] bits in iccr1. (initial setting) 2. set the trs bit in iccr1 to select the transmit mode. then, tdre in icsr is set. 3. confirm that tdre has been set. then, wr ite the transmit data to icdrt. the data is transferred from icdrt to icdrs, and td re is set automatically. the continuous transmission is performed by writing data to icdrt every time tdre is set. when changing from transmit mode to receive mode, clear trs while tdre is 1. 12 781 78 1 scl trs tdre icdrt icdrs bit 0 data 1 data 1 data 2 data 3 data 3 data 2 bit 6 bit 7 bit 0 bit 6 bit 7 bit 0 bit 1 sda (output) user processing [3] write data to icdrt [3] write data to icdrt [3] write data to icdrt [3] write data to icdrt [2] set trs figure 19.14 transmit mode operation timing
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 862 of 1262 rej09b0437-0100 (3) receive operation in receive mode, data is latched at the rise of the transfer clock. the transfer clock is output when mst in iccr1 is 1, and is input when mst is 0. for receive mode operation timing, refer to figure 19.15. the recep tion procedure and operations in r eceive mode are described below. 1. set the ice bit in iccr1 to 1. set bits cks[3:0] in iccr1. (initial setting) 2. when the transfer clock is output, set mst to 1 to start outputting the receive clock. 3. when the receive operation is completed, da ta is transferred from icdrs to icdrr and rdrf in icsr is set. when mst = 1, the ne xt byte can be received, so the clock is continually output. the continuous reception is performed by reading icdrr every time rdrf is set. when the 8th clock is risen while rdrf is 1, the overrun is detected and al/ove in icsr is set. at this time, the pr evious reception data is retained in icdrr. 4. to stop receiving when mst = 1, set rcvd in iccr1 to 1, then read icdrr. then, scl is fixed high after receiving the next byte data. notes: follow the steps below to receive only one byte with mst = 1 specified. see figure 19.16 for the operation timing. 1. set the ice bit in iccr1 to 1. set bits cks[3:0] in iccr1. (initial setting) 2. set mst = 1 while the rcvd bit in iccr1 is 0. this causes the receive clock to be output. 3. check if the bc2 bit in icmr is set to 1 and then set the rcvd bit in iccr1 to 1. this causes the scl to be fixed to the high level after outputting one byte of the receive clock.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 863 of 1262 rej09b0437-0100 12 781 7812 scl mst trs rdrf icdrs icdrr sda (input) bit 0 bit 6 bit 7 bit 0 bit 6 bit 7 bit 0 bit 1 bit 1 user processing data 1 data 1 data 2 data 2 data 3 [2] set mst (when outputting the clock) [3] read icdrr [3] read icdrr figure 19.15 receive mode operation timing 12345678 000 scl mst rcvd 111 110 101 100 011 010 001 000 sda (input) bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 bc2 to bc0 [2] set mst [3] set the rcvd bit after checking if bc2 = 1 figure 19.16 operation timing fo r receiving one byte (mst = 1)
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 864 of 1262 rej09b0437-0100 19.4.7 noise filter the logic levels at the scl and sda pins are routed through noise filters before being latched internally. figure 19.17 shows a block diagram of the noise filter circuit. the noise filter consists of three cascaded latches and a match detector. the scl (or sda) input signal is sampled on the peripheral clock. when nf2cyc is set to 0, this signal is not passed forward to the next circuit unless the outputs of both latches agree. when nf2cyc is set to 1, this signal is not passed forward to the next circuit unle ss the outputs of three latches agree. if they do not agree, the previous value is held. c q d c q d c q 1 0 d nf2cyc scl or sda input signal internal scl or sda signal sampling clock sampling clock peripheral clock cycle latch latch match detector latch match detector figure 19.17 block diagram of noise filter
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 865 of 1262 rej09b0437-0100 19.4.8 example of use flowcharts in respective modes that use the i 2 c bus interface 3 are shown in figures 19.18 to 19.21. bbsy=0 ? no tend=1 ? no yes start [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [13] [14] [15] initialize set mst and trs in iccr1 to 1 write 1 to bbsy and 0 to scp write transmit data in icdrt write 0 to bbsy and scp set mst and trs in iccr1 to 0 read bbsy in iccr2 read tend in icsr read ackbr in icier master receive mode yes ackbr=0 ? write transmit data in icdrt read tdre in icsr read tend in icsr clear tend in icsr read stop in icsr clear tdre in icsr end write transmit data in icdrt transmit mode? no yes tdre=1 ? last byte? stop=1 ? no no no no no yes yes tend=1 ? yes yes yes [1] test the status of the scl and sda lines. [2] set master transmit mode. [3] issue the start condition. [4] set the first byte (slave address + r/ w ) of transmit data. [5] wait for 1 byte to be transmitted. [6] test the acknowledge transferred from the specified slave device. [7] set the second and subsequent bytes (except for the final byte) of transmit data. [8] wait for icdrt empty. [9] set the last byte of transmit data. [10] wait for last byte to be transmitted. [11] clear the tend flag. [12] clear the stop flag. [13] issue the stop condition. [14] wait for the creation of stop condition. [15] set slave receive mode. clear tdre. [12] clear stop in icsr figure 19.18 sample flowch art for master transmit mode
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 866 of 1262 rej09b0437-0100 [10] no yes rdrf=1 ? no yes rdrf=1 ? last receive - 1? master receive mode clear tend in icsr set trs in iccr1 to 0 clear tdre in icsr set ackbt in icier to 0 dummy-read icdrr read rdrf in icsr read icdrr set ackbt in icier to 1 set rcvd in iccr1 to 0 read icdrr read rdrf in icsr write 0 to bbsy and scp read stop in icsr read icdrr clear rcvd in iccr1 to 0 set mst in iccr1 to 0 end no yes stop=1 ? no yes [1] clear tend, select master receive mode, and then clear tdre. * 1 [2] set acknowledge to the transmit device. * 1 [3] dummy-read icddr. * 1 [4] wait for 1 byte to be received. * 2 [5] check whether it is the (last receive - 1). * 2 [6] read the receive data. [7] set acknowledge of the final byte. disable continuous reception (rcvd = 1). * 2 [8] read the (final byte - 1) of received data. [9] wait for the last byte to be receive. [10] clear the stop flag. [11] issue the stop condition. [12] wait for the creation of stop condition. [13] read the last byte of receive data. [14] clear rcvd. [15] set slave receive mode. [1] [2] [3] [4] [5] [6] [7] [8] [9] [11] [12] [13] [14] [15] notes: 1. make sure that no interrupt will be generated during steps [1] to [3]. 2. at last receive - 1 (when (5) is satisfied), ensure that no interrupt occurs during the processing of (4), (5), or (7). supplementary information when the size of receive data is only one byte in reception, steps [2] to [6] are skipped after step [1], before jumping to step [7]. the step [8] is dummy-read in icdrr. clear stop in icsr figure 19.19 sample flowch art for master receive mode
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 867 of 1262 rej09b0437-0100 tdre=1 ? yes yes no slave transmit mode clear aas in icsr write transmit data in icdrt read tdre in icsr last byte? write transmit data in icdrt read tend in icsr clear tend in icsr set trs in iccr1 to 0 dummy-read icdrr clear tdre in icsr end [1] clear the aas flag. [2] set transmit data for icdrt (except for the last byte). [3] wait for icdrt empty. [4] set the last byte of transmit data. [5] wait for the last byte to be transmitted. [6] clear the tend flag. [7] set slave receive mode. [8] dummy-read icdrr to release the scl. [9] clear the tdre flag. no no yes tend=1 ? [1] [2] [3] [4] [5] [6] [7] [8] [9] figure 19.20 sample flowchart for slave transmit mode
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 868 of 1262 rej09b0437-0100 no yes rdrf=1 ? no yes rdrf=1 ? last receive - 1? slave receive mode clear aas in icsr set ackbt in icier to 0 dummy-read icdrr read rdrf in icsr read icdrr set ackbt in icier to 1 read icdrr read rdrf in icsr read icdrr end no yes [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [1] clear the aas flag. [2] set acknowledge to the transmit device. [3] dummy-read icdrr. [4] wait for 1 byte to be received. [5] check whether it is the (last receive - 1). [6] read the receive data. [7] set acknowledge of the last byte. [8] read the (last byte - 1) of receive data. [9] wait the last byte to be received. [10] read for the last byte of receive data. note: when the size of receive data is only one byte in reception, steps [2] to [6] are skipped after step [1], before jumping to step [7]. the step [8] is dummy-read in icdrr. figure 19.21 sample flowch art for slave receive mode
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 869 of 1262 rej09b0437-0100 19.5 interrupt requests there are six interrupt requ ests in this module; transmit data em pty, transmit end, receive data full, nack detection, stop recognition, and arbitratio n lost/overrun error. table 19.4 shows the contents of each interrupt request. table 19.4 interrupt requests interrupt request abbreviation interrupt condition i 2 c bus format clocked synchronous serial format transmit data empty txi (tdre = 1) ? (tie = 1) transmit end tei (tend = 1) ? (teie = 1) receive data full rxi (rdrf = 1) ? (rie = 1) stop recognition stpi (stop = 1) ? (stie = 1) ? nack detection ? arbitration lost/ overrun error naki {(nackf = 1) + (al = 1)} ? (nakie = 1) when the interrupt condition described in table 19.4 is 1, the cpu executes an interrupt exception handling. note that a txi or rxi interrupt can activate the dmac if the setting for dmac activation has been made. in such a case, an inte rrupt request is not sent to the cpu. interrupt sources should be cleared in the exception handlin g. the tdre and tend bits are automatically cleared to 0 by writing the transmit data to icdrt. the rdrf bit is automa tically cleared to 0 by reading icdrr. the tdre bit is set to 1 again at the same time when the transmit data is written to icdrt. therefore, when the td re bit is cleared to 0, then an excessive data of one byte may be transmitted.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 870 of 1262 rej09b0437-0100 19.6 bit synchronous circuit in master mode, this module has a possibility that high level period may be short in the two states described below. ? when scl is driven to low by the slave device ? when the rising speed of scl is lowered by the load of the scl line (load capacitance or pull- up resistance) therefore, it monitors scl and communicates by bit with synchronization. figure 19.22 shows the timing of the bit synchronous circuit and table 19.5 shows the time when the scl output changes from low to hi-z then scl is monitored.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 871 of 1262 rej09b0437-0100 synchronization clock*1 scl pin internal scl monitor synchronization clock * 1 scl pin internal scl monitor synchronization clock*1 scl pin internal scl monitor v ih internal delay * 2 internal delay * 2 the monitor value is at a low level. scl does not produce a low-level output. scl does not produce a low-level output. scl monitor time v ih internal delay * 2 v ih the monitor value is at a low level. the monitor value is at a high level. scl monitor time scl monitor time scl monitor time this is different from the set frequency. low-level output from the slave the monitor value is at a high level. internal delay * 2 v ih scl monitor time the monitor value is at a high level. notes: 1. clock of the transfer rate set by the cks3 to cks0 bits in i2c bus control register 1 (iccr1) 2. the value is 3 to 4 tpcyc when the nf2cyc bit in the nf2cyc register (nf2cyc) is 0; the value is 4 to 5 tpcyc when the nf2cyc bit is 1. (a) under normal conditions (b) when the slave device is first driven to a low level (c) when rising of scl is gradual figure 19.22 bit synchronous circuit timing
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 872 of 1262 rej09b0437-0100 table 19.5 time for monitoring scl cks3 cks2 time for monitoring scl * 1 0 9 tpcyc * 2 0 1 21 tpcyc * 2 0 19 tpcyc * 2 1 1 81 tpcyc * 2 notes: 1. monitors the (on-boar d) scl level after the time (p cyc) for monitoring scl has passed since the rising edge of the scl monitor timing reference clock. 2. pcyc = p cyc
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 873 of 1262 rej09b0437-0100 19.7 usage notes 19.7.1 notes on working in multi-master mode when working in multi-master mode, if the setting for the transfer route of the lsi (cks3 to cks0 in iccr1) is lower than that for any other master, an scl with an unexpected width may be output occasionally. the transfer rate that is set here must be at leas t 1/1.8 times the highest transfer rate of the other masters. 19.7.2 notes on working in master receive mode if the icdrr is read near the falling edge of the eighth clock, no receive data may be captured. if rcvd = 1 is set near the falling edge of the eigh th clock when the receive buffer is full, no stop conditions may be issued. use either of the following methods. 1. in master receive mode, reading the icdrr sh ould be performed before the falling edge of the eighth is detected. 2. in master receive mode, rcvd = 1 should be set so that processing proceeds on a per-byte basis. 19.7.3 notes on setting ack bt in master receive mode when working in master receive mode, the ackb t should be set before the eighth scl in the final data being transferred continuously starts falling. otherwise, the slave?s sending device might overrun.
section 19 i 2 c bus interface 3 (iic3) rev. 1.00 nov. 14, 2007 page 874 of 1262 rej09b0437-0100 19.7.4 notes on the states of mst and trn bits when arbitration is lost if the multi-master is used and the mst and trs bits are operated seque ntially to assign the master send setting, a conflict may occur as seen in the combination of al = 1 in icsr and master receive mode (mst = 1 and trs = 1), depending on the timing when arbitration is lost while the bit manipulation instruction in the trs is being executed. the following methods can be used to avoid this phenomenon. ? when working in multi-master mode, use the mov instruction to set the mst and trs. ? if arbitration is lost, confirm the mst = 0 and trs = 0 settings. if any settings other than mst = 0 and trs = 0 are found, the mst = 0 and trs = 0 settings must be performed again.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 875 of 1262 rej09b0437-0100 section 20 host interface (hif) this lsi incorporates a host in terface (hif) for use in high-speed transfer of data between external devices which cannot utilize the system bus. the hif allows external devices to read from and write to 4 kbytes (2 kbytes 2 banks) of the on- chip ram exclusively for hif use (hifram) within this lsi, in 32-bit units. interrupts issued to this lsi by an external device, interrupts sent from this lsi to the external device, and dma transfer requests sent from this lsi to the external device are also supported. by using hifram and these interrupt functions, software-based data transfer between external devices and this lsi becomes possible, and connection to external devi ces not releasing bus mastership is enabled. using hifram, the hif also supports hif boot mode allowing this lsi to be booted. 20.1 features the hif has the following features. ? an external device can read from or write to hifram in 32-bit units via the hif pins (access in 8-bit or 16-bit units not allowed). the on-chip cpu can read from or write to hifram in 8- bit, 16-bit, or 32-bit units, via the internal peripheral bus. the hifram access mode can be specified as bank mode or non-bank mode. ? when an external device accesses hifram vi a the hif pins, automatic increment of addresses and the endian can be specifi ed with the hif internal registers. ? by writing to specific bits in the hif internal registers from an external device, or by accessing the end address of hifram from the external device, interrupts (internal interrupts) can be issued to the on-chip cpu. conversely, by writing to specific bits in the hif internal registers from the on-chip cpu, interrupts (external interrupts) or dmac transfer requests can be sent from the on-chip cpu to the external device. ? there are seven interrupt source bits each for internal interr upts and external interrupts. accordingly, software control of 128 different interrupts is possible, enabling high-speed data transfer using interrupts. ? in hif boot mode, this lsi can be booted from hifram by an external device storing the instruction code in hifram.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 876 of 1262 rej09b0437-0100 figure 20.1 shows a block diagram of the hif. hifscr hifdata hifiicr hifmcr hifeicr hifbcr hifadr hifdtr hifbicr hifidx hifgsr hifcs hifrs hifwr hifrd hifmd hifint hifdreq hifd15 to hifd00 hif hifrdy hifebl hifi hifbi select hifram control circuit internal bus [legend] hif index register hif general status register hif status/control register hif memory control register hif internal interrupt control register hif external interrupt control register hifidx: hifgsr: hifscr: hifmcr: hifiicr: hifeicr: hif address register hif data register hif boot control register hifdreq trigger register hif bank interrupt control register hif interrupt (internal interrupt) hif bank interrupt (internal interrupt) hifadr: hifdata: hifbcr: hifdtr: hifbicr: hifi: hifib: hifram figure 20.1 block diagram of hif
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 877 of 1262 rej09b0437-0100 20.2 input/output pins table 20.1 shows the hif pin configuration. table 20.1 pin configuration name abbreviation i/o description hif data pins hifd15 to hifd00 i/o address, data, or command input/output to the hif hif chip select hifcs input chip select input to the hif hif register select hifrs input switching between hif access types 0: normal access (other than below) 1: index register write hif write hifwr input write strobe signal. low level is input when an external device writes data to the hif. hif read hifrd input read strobe signal. low level is input when an external device reads data from the hif. hif interrupt hifint output interrupt request to an external device from the hif hif mode hifmd input selects whether or not this lsi is started up in hif boot mode. if a power-on reset is canceled when high level is input, this lsi is started up in hif boot mode. hifdmac transfer request hifdreq output to an external device, dmac transfer request with hifram as the destination hif boot ready hifrdy output indicates t hat the hif reset is canceled in this lsi and access from an external device to the hif can be accepted. after 20 clock cycles (max.) of the peripheral clock following negate of the reset input pin of this lsi, this pin is asserted. hif pin enable hifebl input all hif pins other than this pin are asserted by high-level input.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 878 of 1262 rej09b0437-0100 20.3 parallel access 20.3.1 operation the hif can be accessed by combining the hifcs , hifrs, hifwr , and hifrd pins. table 20.2 shows the correspondence betw een combinations of these signals and hif operations. table 20.2 hif operations hifcs hifrs hifwr hifrd operation 1 * * * no operation (nop) 0 1 0 1 write to index register (hifidx[7:0]) 0 0 0 1 write to register specified by hifidx[7:0] 0 0 1 0 read from register specified by hifidx[7:0] 0 * 1 1 no operation (nop) 0 * 0 0 setting prohibited [legend] * : don't care 20.3.2 connection method when connecting the hif to an external device, a method like that shown in figure 20.2 should be used. external device cs a02 wr rd d15 to d00 hif hifcs hifrs hifwr hifrd hifd15 to hifd00 figure 20.2 hif connection example
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 879 of 1262 rej09b0437-0100 20.4 register descriptions the hif has the following registers. ? hif index register (hifidx) ? hif general status register (hifgsr) ? hif status/control register (hifscr) ? hif memory control register (hifmcr) ? hif internal interrupt control register (hifiicr) ? hif external interrupt control register (hifeicr) ? hif address register (hifadr) ? hif data register (hifdata) ? hif boot control register (hifbcr) ? hifdreq trigger register (hifdtr) ? hif bank interrupt control register (hifbicr)
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 880 of 1262 rej09b0437-0100 20.4.1 hif index register (hifidx) hifidx is a 32-bit register used to specify the register read from or written to by an external device when the hifrs pin is held low. hifidx can be only read by the on-chip cpu. hifidx can be only written to by an external device while the hifrs pin is driven high. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrr/wr/wr/wr/wr/wr/wr/wr/w ???????? ? ??? reg5 ??????? ???? ? reg4 reg3 reg2 reg1 reg0 byte1 byte0 bit bit name initial value r/w description 31 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 6 5 4 3 2 reg5 reg4 reg3 reg2 reg1 reg0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w hif internal register select these bits specify which register among hifgsr, hifscr, hifmcr, hifii cr, hifeicr, hifadr, hifdata, and hifbcr is accessed by an external device. 000000: hifgsr 000001: hifscr 000010: hifmcr 000011: hifiicr 000100: hifeicr 000101: hifadr 000110: hifdata 001111: hifbcr other than above: setting prohibited
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 881 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1 0 byte1 byte0 0 0 r/w r/w internal register byte specification these bits specify in advance the target word location before the external device accesses a register among hifgsr, hifscr, hifmcr, hi fiicr, hifeicr, hifadr, hifdata, and hifbcr. see also section 20.8, alignment control. ? when hifscr.bo = 0 00: bits 31 to 16 in register 01: setting prohibited 10: bits 15 to 0 in register 11: setting prohibited ? when hifscr.bo = 1 00: bits 15 to 0 in register 01: setting prohibited 10: bits 31 to 16 in register 11: setting prohibited however, when hifdata is selected using bits reg5 to reg0, each time reading or writing of hifdata occurs, these bits change according to the following rule. 00 10 00 10... repeated
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 882 of 1262 rej09b0437-0100 20.4.2 hif general status register (hifgsr) hifgsr is a 32-bit register, which can be freely used for handshaking between an external device connected to the hif and the softwa re of this lsi. hifgsr can be read from and written to by the on-chip cpu. access to hifgsr by an external device should be performed with hifgsr specified by bits reg5 to reg0 in hifidx and the hifrs pin low. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ????????? status[15:0] ??????? bit bit name initial value r/w description 31 to 16 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 15 to 0 status[15:0] a ll 0 r/w general status this register can be read from and written to by an external device connected to the hif, and by the on- chip cpu. these bits are initialized only at a power- on reset.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 883 of 1262 rej09b0437-0100 20.4.3 hif status/control register (hifscr) hifscr is a 32-bit register used to control the hifram access mode and endian setting. hifscr can be read from and written to by the on- chip cpu. access to hi fscr by an external device should be performed with hifscr specified by bits reg5 to reg0 in hifidx and the hifrs pin low. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 00000000010/100000 rrrrr/wr/wr/wr/wrrrrrr/wr/wr/w ???????? ? dpol bmd bsel ? ??????? ???? dmd ? md1 ?? wbswp edn bo bit bit name initial value r/w description 31 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 10 dmd dpol 0 0 r/w r/w dreq mode dreq polarity controls the assert mode for the hifdreq pin. for details on the negate timing, see section 20.7, external dmac interface. 00: for a dmac transfer request to an external device, low level is generated at the hifdreq pin. the default for the hifdreq pin is high-level output. 01: for a dmac transfer request to an external device, high level is generated at the hifdreq pin. the default for the hifdreq pin is low-level output. 10: for a dmac transfer request to an external device, falling edge is generated at the hifdreq pin. the default for the hifdreq pin is high-level output. 11: for a dmac transfer request to an external device, rising edge is generated at the hifdreq pin. the default for the hifdreq pin is low-level output.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 884 of 1262 rej09b0437-0100 bit bit name initial value r/w description 9 8 bmd bsel 0 0 r/w r/w hifram bank mode hifram bank select controls the hifram access mode. 00: both an external device and the on-chip cpu can access bank 0. when access by both of these conflict, even though the access addresses differ, access by the external device is processed before access by the on-chip cpu. bank 1 cannot be accessed. 01: both an external device and the on-chip cpu can access bank 1. when access by both of these conflict, even though the access addresses differ, access by the external device is processed before access by the on-chip cpu. bank 0 cannot be accessed. 10: an external device can access only bank 0 while the on-chip cpu can access only bank 1. 11: an external device can access only bank 1 while the on-chip cpu can access only bank 0. 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 5 md1 0/1 r hif mode 1 indicates whether this lsi was started up in hif boot mode or non-hif boot mode. this bit stores the value of the hifmd pin sampled at a power-on reset 0: started up in non-hif boot mode (booted from the memory connected to area 0) 1: started up in hif boot mode (booted from hifram) 4, 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 885 of 1262 rej09b0437-0100 bit bit name initial value r/w description 2 wbswp 0 r/w byte order for access of hifdata specifies the byte order when an external device accesses hifdata. see also section 20.8, alignment control. 0: aligned according to the bo bit. 1: swapped in word units from the big endian order and then swapped in byte units within each word. the setting of the bo bit is ignored. 1 edn 0 r/w endian for hifram access specifies the byte order when hifram is accessed by the on-chip cpu. 0: big endian (msb first) 1: little endian (lsb first) 0 bo 0 r/w byte order for access of all hif registers including hifdata specifies the byte order when an external device accesses all hif register s including hifdata. however, for the hifdata alignment, this bit is referred to only when wbswp = 0 and ignored when wbswp = 1. see also section 20.8, alignment control. 0: big endian (msb first) 1: little endian (lsb first)
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 886 of 1262 rej09b0437-0100 20.4.4 hif memory control register (hifmcr) hifmcr is a 32-bit register used to control hifram. hifmcr can be only read by the on-chip cpu. access to hifmcr by an external device should be performed with hifmcr specified by bits reg5 to reg0 in hifidx and the hifrs pin low. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 151413121110987654321 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrr/w * r r/w * r note: * changing the hifram banks accessible from an external device by setting the bmd and bsel bits in hifscr does not affect the setting of this bit. r/w * r r r/w * ???????? ? ??? lock ??????? ???? ? ? wt ? rd ?? ai/ad bit bit name initial value r/w description 31 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 lock 0 r/w * lock this bit is used to lock the access direction (read or write) for consecutive access of hifram by an external device via hifdata. when this bit is set to 1, the values of the rd and wt bits set at the same time are held until this bit is next cleared to 0. when the rd bit and this bit are simultaneously set to 1, consecutive read mode is entered. when the wt bit and this bit are simultaneously set to 1, consecutive write mode is entered. both the rd and wt bits should not be set to 1 simultaneously. 6 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 887 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 wt 0 r/w * write when this bit is set to 1, the hifdata value is written to the hifram position corresponding to hifadr. if this bit and the lock bit are set to 1 simultaneously, hifram consecutive writ e mode is entered, and high- speed data transfer becomes possible. this mode is maintained until this bit is next cleared to 0, or until the lock bit is cleared to 0. if the lock bit is not simultaneously set to 1 with this bit, writing to hifram is performed only once. thereafter, the value of this bit is automatically cleared to 0. 4 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 3 rd 0 r/w * read when this bit is set to 1, the hifram data corresponding to hifadr is fetched to hifdata. if this bit and the lock bit are set to 1 simultaneously, hifram consecutive read mode is entered, and high- speed data transfer becomes possible. this mode is maintained until this bit is next cleared to 0, or until the lock bit is cleared to 0. if the lock bit is not simultaneously set to 1 with this bit, reading of hifram is performed only once. thereafter, the value of this bit is automatically cleared to 0. 2, 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 ai/ad 0 r/w * address auto-increment/decrement this bit is valid only when the lock bit is 1. the value of hifadr is automatically incremented by 4 or decremented by 4 according to the setting of this bit each time reading or writing of hifram is performed. 0: auto-increment mode (+4) 1: auto-decrement mode ( ? 4) note: * changing the hifram banks accessible from an external device by setting the bmd and bsel bits in hifscr does not affect the setting of this bit.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 888 of 1262 rej09b0437-0100 20.4.5 hif internal interrupt control register (hifiicr) hifiicr is a 32-bit register used to issue interr upts from an external device connected to the hif to the on-chip cpu. access to hi fiicr by an external device sh ould be performed with hifiicr specified by bits reg5 to reg0 in hifidx and the hifrs pin low. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrr/wr/wr/wr/wr/wr/wr/wr/w ???????? ? ??? iic6 ??????? ???? ? iic5 iic4 iic3 iic2 iic1 iic0 iir bit bit name initial value r/w description 31 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 6 5 4 3 2 1 iic6 iic5 iic4 iic3 iic2 iic1 iic0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w internal interrupt source these bits specify the source for interrupts generated by the iir bit. these bits can be written to from both an external device and the on-chip cpu. by using these bits, fast execution of interrupt ex ception handling is possible. these bits are completely under software control, and their values have no effect on the operation of this lsi. 0 iir 0 r/w internal interrupt request while this bit is 1, an interrupt request (hifi) is issued to the on-chip cpu.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 889 of 1262 rej09b0437-0100 20.4.6 hif external interrupt control register (hifeicr) hifeicr is a 32-bit register used to issue interru pts to an external device connected to the hif from this lsi. access to hifeicr by an external device should be performed with hifeicr specified by bits reg5 to reg0 in hifidx and the hifrs pin low. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 151413121110987654321 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrr/wr/wr/wr/wr/wr/wr/wr/w ???????? ? ??? eic6 ??????? ???? ? eic5 eic4 eic3 eic2 eic1 eic0 eir bit: initial value: r/w: bit bit name initial value r/w description 31 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 6 5 4 3 2 1 eic6 eic5 eic4 eic3 eic2 eic1 eic0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w external interrupt source these bits specify the source for interrupts generated by the eir bit. these bits can be written to from both an external device and the on-chip cpu. by using these bits, fast execution of interrupt ex ception handling is possible. these bits are completely under software control, and their values have no effect on the operation of this lsi. 0 eir 0 r/w external interrupt request while this bit is 1, the hifint pin is asserted to issue an interrupt request to an external device from this lsi.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 890 of 1262 rej09b0437-0100 20.4.7 hif address register (hifadr) hifadr is a 32-bit register which indicates the ad dress in hifram to be accessed by an external device. when using the lock bit setting in hi fmcr to specify consecutive access of hifram, auto-increment (+4) or auto-decrement (-4) of th e address, according to the ai/ad bit setting in hifmcr, is performed automatically, and hifadr is updated. hifadr can be only read by the on-chip cpu. access to hifadr by an external device should be performed with hifadr specified by bits reg5 to reg0 in hifidx and the hifrs pin low. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r r ???????????????? ???? ? a[10:2] ?? bit bit name initial value r/w description 31 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 10 to 2 a[10:2] all 0 r/w hi fram address specification these bits specify the address of hifram to be accessed by an external device, with 32-bit boundary. 1, 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 891 of 1262 rej09b0437-0100 20.4.8 hif data register (hifdata) hifdata is a 32-bit register used to hold data to be written to hifram and data read from hifram for external device accesse s. if hifdata is not used when accessing hifram, it can be used for data transfer between an external device connected to the hif and the on-chip cpu. hifdata can be read from and written to by the on-chip cpu. acces s to hifdata by an external device should be performed with hifdat a specified by bits reg5 to reg0 in hifidx and the hifrs pin low. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w d[31:16] d[15:0] bit bit name initial value r/w description 31 to 0 d[31:0] all 0 r/w 32-bit data 20.4.9 hif boot control register (hifbcr) hifbcr is a 32-bit register for exclusive control of an external device and the on-chip cpu regarding access of hifram. hifbcr can be only read by the on-chip cpu. access to hifbcr by an external device should be performed with hifbcr specified by bits reg5 to reg0 in hifidx and the hifrs pin low. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000/1 rrrrrrrrr/wr/wr/wr/wr/wr/wr/wr/w ???????? ? ???? ??????? ???? ? ?????? ac
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 892 of 1262 rej09b0437-0100 bit bit name initial value r/w description 31 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 to 1 ? all 0 r/w ac-bit writing assistance these bits should be used to write the bit pattern (h'a5) needed to set the ac bit to 1. these bits are always read as 0. 0 ac 0/1 r/w hifram access exclusive control controls accessing of hifram by the on-chip cpu for the hifram bank selected by the bmd and bsel bits in hifscr as the bank allowed to be accessed by this lsi. 0: the on-chip cpu can perform reading/writing of hifram. 1: when an hifram read/writ e operation by the on-chip cpu occurs, the cpu enters the wait state, and execution of the instruction is halted until this bit is cleared to 0. when booted in non-hif boot m ode, the initial value of this bit is 0. when booted in hif boot mode, the initial value of this bit is 1. after an external device writes a boot program to hifram via the hif, clearing this bit to 0 boots the on- chip cpu from hifram. when 1 is written to this bit by an external device, h'a5 should be written to bits 7 to 0 to prevent erroneous writing.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 893 of 1262 rej09b0437-0100 20.4.10 hifdreq trigger register (hifdtr) hifdtr is a 32-bit register. writing to hifdtr by the on-chip cpu asserts the hifdreq pin. hifdtr cannot be accessed by an external device. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr/w ???????? ? ? ???? ? ???? - ??? ?? ???? ? ?? dtrg bit bit name initial value r/w description 31 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 dtrg 0 r/w hifdreq trigger when 1 is written to this bit, the hifdreq pin is asserted according to the setting of the dmd and dpol bits in hifscr. this bit is automatically cleared to 0 in synchronization with negate of the hifdreq pin. though this bit can be set to 1 by the on-chip cpu, it cannot be cleared to 0. to avoid conflict between clearing of this bit by negate of the hifdreq pin and setting of this bit by the on- chip cpu, make sure this bit is cleared to 0 before setting this bit to 1 by the on-chip cpu. writing 0 is invalid.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 894 of 1262 rej09b0437-0100 20.4.11 hif bank interrupt control register (hifbicr) hifbicr is a 32-bit register th at controls hif bank interrupts . hifbicr cannot be accessed by an external device. rrrrrrrrrrrrrrrr rrrrrrrrrrrrrrr/wr/w 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 0000000000000000 ???????? ? ? ???? ? ???? - ??? ?? ???? ? ? bie bif bit bit name initial value r/w description 31 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 bie 0 r/w bank interrupt enable enables or disables a bank interrupt request (hifbi) issued to the on-chip cpu. 0: hifbi disabled 1: hifbi enabled
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 895 of 1262 rej09b0437-0100 bit bit name initial value r/w description 0 bif 0 r/w bank interrupt request flag while this bit is 1, a bank interrupt request (hifbi) is issued to the on-chip cpu according to the setting of the bie bit. in auto-increment mode (ai/ad bit in hifmcr is 0), this bit is automatically set to 1 when an external device has completed access to the 32-bit data in the end address of hifram and the hifcs pin has been negated. in auto-decrement mode (ai/ad bit in hifmcr is 1), this bit is automatically set to 1 when an external device has completed access to the 32-bit data in the start address of hifram and the hifcs pin has been negated. though this bit can be cleared to 0 by the on-chip cpu, it cannot be set to 1. make sure setting of this bit by hifram access from an external device and clearing of this bit by the on- chip cpu do not conflict using software. writing 1 is invalid.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 896 of 1262 rej09b0437-0100 20.5 memory map table 20.3 shows the memory map of hifram. table 20.3 memory map classification start address end address memory size map from external device * 1 h'0000 h'07ff 2 kbytes map from on-chip cpu * 1 * 2 h'ffff_f000 h'ffff_f7ff 2 kbytes notes: 1. map for a single hifram bank. which bank is to be accessed by an external device or the on-chip cpu depends on the bmd an d bsel bits in hifscr. the mapping addresses are common between the banks. 2. in hif boot mode, however, bank 0 is sele cted and the first 2 kbytes of the first-half 32 mbytes in the following areas are also mapped: (1) the cacheable area 0 in the h'0000_0000 to h'0000_07ff range and (2 ) the non-cacheable area 0 in the h'2000_0000 to h'2000_07ff range. if an external device modifies hifram w hen hifram is accessed from the cacheable area with the cache enabled, a coherency problem will occur. when the cache is enabled, accessing hifram from the non-cacheable area is recommended. in hif boot mode, among the first-half 32 mb ytes of each area 0, access to only the addresses to which hifram is mapped is permitted. even in hif boot mode, the areas excluding the first-half 32 mbytes of area 0 are mapped to the external memory as normally.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 897 of 1262 rej09b0437-0100 20.6 interface 20.6.1 basic sequence figure 20.3 shows the basic read/write sequence. hif read is defined by the overlap period of the hifrd low-level period and hifcs low-level period, and hif write is defined by the overlap period of the hifwr low-level period and hifcs low-level period. the hifrs signal indicates whether this is normal access or index register access; low level indicates normal access and high level indicates index register access. hifcs hifrs write cycle read cycle hifrd hifwr hifd15 to hifd00 wt_d rd_d figure 20.3 basic ti ming for hif interface
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 898 of 1262 rej09b0437-0100 20.6.2 reading/writing of hif registers other than hifidx and hifidx as shown in figure 20.4, in reading and writing of hif internal registers other than hifidx and hifidx, first hifrs is held high and hifidx is wr itten to in order to sel ect the register to be accessed and the byte location. then hifrs is held low, and reading or writing of the register selected by hifidx is performed. hifcs hifrs hifrd hifwr hifd15 to hifd00 wt_d hifidx rd_d index write register write register read register selection figure 20.4 hif register settings
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 899 of 1262 rej09b0437-0100 20.6.3 consecutive data writing to hifram by external device figure 20.5 shows the timing chart for consecutiv e data transfer from an external device to hifram. as shown in this timing chart, by setting the start address and the data to be written first, consecutive data transfer can subsequently be performed. hifcs hifrs hifrd hifwr hifd15 to hifd00 0016 ahal 0018 d0d1 001a d2d3 000a 00a0 0018 d4d5 d8d9 d6d7 high level hifadr setting [15:8] = ah [7:0] = al data for first write operation set in hifdata [31:24] = d0, [23:16] = d1, [15:8] = d2, [7:0] = d3 hifmcr setting consecutive write auto-increment hifdata selection consecutive data writing figure 20.5 consecutive data writing to hifram
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 900 of 1262 rej09b0437-0100 20.6.4 consecutive data reading from hifram to external device figure 20.6 shows the timing chart for consecutiv e data reading from hifram to an external device. as this timing chart indicates, by setting the start address, data can subsequently be read out consecutively. hifcs hifrs hifrd hifwr 0016 ahal 000a 0088 0018 d0d1 d2d3 d4d5 d6d7 d8d9 dcdd dadb hifadr setting [15:8] = ah [7:0] = al hifmcr setting consecutive read auto-increment consecutive data reading hifdata selection hifd15 to hifd00 figure 20.6 consecutive data reading from hifram
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 901 of 1262 rej09b0437-0100 20.7 external dmac interface figures 20.7 to 20.10 show the hifdreq output timing. the start of the hifdreq assert synchronizes with the dtrg bit in hifdtr being set to 1. the hifdreq negate timing and assert level are determined by the dmd and dpol bits in hifscr, respectively. when the external dmac is specified to detect low level of the hifdreq signal, set dmd = 0 and dpol = 0. after writing 1 to the dtrg bit, the hifdreq signal remains low until a read from or write to the hifidx-specified register is detected. writing to the index register (hifidx) does not negate the signal. dtrg bit dpol bit hifdreq asserted in synchronization with the dtrg bit being set by the on-chip cpu. the dtrg bit is cleared simultaneously with hifdreq negate. negated if a read from or write to the hifidx-specified register is detected. the latency is within tpcyc (cycle of the peripheral clock) 5cyc. hifcs hifrs figure 20.7 hifdreq timing (when dmd = 0 and dpol = 0) when the external dmac is specified to detect high level of the hifdreq signal, set dmd = 0 and dpol = 1. at the time the dpol bit is set to 1, hifdreq becomes low. after this, the hifdreq signal remains low from when 1 is writte n to the dtrg bit until a read from or write to the hifidx-specified register is detected. wr iting to the index register (hifidx) does not negate the signal. dtrg bit dpol bit hifdreq hifcs hifrs negated in synchronization with the dpol bit being set by the on-chip cpu. the dtrg bit is cleared simultaneously with hifdreq negate. negated if a read from or write to the hifidx-specified register is detected. the latency is within tpcyc (cycle of the peripheral clock) 5cyc. asserted in synchronization with the dtrg bit being set by the on-chip cpu. figure 20.8 hifdreq timing (when dmd = 0 and dpol = 1)
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 902 of 1262 rej09b0437-0100 when the external dmac is specified to detect the falling edge of the hifdreq signal, set dmd = 1 and dpol = 0. after writing 1 to the dtrg bit, a low pulse of 32 peripheral clock cycles is generated at the hifdreq pin. dtrg bit dpol bit hifdreq after assert, negated when t pcyc (peripheral clock cycle) 32 cyc have elapsed. asserted in synchronization with the dtrg bit being set by the on-chip cpu. the dtrg bit is cleared simultaneously with hifdreq negate. figure 20.9 hifdreq timing (when dmd = 1 and dpol = 0) when the external dmac is specified to detect the rising edge of the hifdreq signal, set dmd = 1 and dpol = 1. at the time the dpol bit is set to 1, hifdreq becomes low. then after writing 1 to the dtrg bit, a low pulse of 32 peripheral clock cycles is generated at the hifdreq pin. dtrg bit dpol bit hifdreq after assert, negated when t pcyc (peripheral clock cycle) 32 cyc have elapsed. asserted in synchronization with the dtrg bit being set by the on-chip cpu. the dtrg bit is cleared simultaneously with hifdreq negate. negated in synchronization with the dpol bit being set by the on-chip cpu. figure 20.10 hifdreq timing (when dmd = 1 and dpol = 1) when the external dmac supports intermittent op erating mode (block tran sfer mode), efficient data transfer can be implemented by using th e hifram consecutive acce ss and bank functions.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 903 of 1262 rej09b0437-0100 table 20.4 consecutive write proced ure to hifram by external dmac external device this lsi no. cpu dmac hif cpu 1 hif initial setting hif initial setting 2 dmac initial setting 3 set hifadr to hifram end address ? 8 4 select hifdata and write dummy data (4 bytes) to hifdata 5 set hifram consecutive write with address increment in hifmcr 6 select hifdata and write dummy data (4 bytes) to hifdata hif bank interrupt occurs hifram bank switching by hif bank interrupt handler (external device accesses bank 1 and on- chip cpu accesses bank 0) 7 activate dmac assert hifdreq set dtrg bit to 1 8 consecutive data write to bank 1 in hifram 9 write to end address of bank 1 in hifram completes and operation halts hif bank interrupt occurs hifram bank switching by hif bank interrupt handler (external device accesses bank 0 and on- chip cpu accesses bank 1) 10 re-activate dmac assert hifdreq set dtrg bit to 1
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 904 of 1262 rej09b0437-0100 external device this lsi no. cpu dmac hif cpu 11 consecutive data write to bank 0 in hifram read data from bank 1 in hifram 12 write to end address of bank 0 in hifram completes and operation halts hif bank interrupt occurs hifram bank switching by hif bank interrupt handler (external device accesses bank 1 and on- chip cpu accesses bank 0) 13 re-activate dmac assert hifdreq set dtrg bit to 1 hereafter no. 11 to 13 are repeated. when a regi ster other than hifdata is accessed (except that hifgsr read with hifrs = low), hifram cons ecutive write is interrupted, and no. 3 to 6 need to be done again. table 20.5 consecutive read procedure from hifram by external dmac external device this lsi no. cpu dmac hif cpu 1 hif initial setting hif initial setting 2 dmac initial setting 3 set hifadr to hifram start address 4 set hifram consecutive read with address increment in hifmcr 5 select hifdata 6 write data to bank 1 in hifram
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 905 of 1262 rej09b0437-0100 external device this lsi no. cpu dmac hif cpu 7 after writing data to end address of bank 1 in hifram, perform hifram bank switching (external device accesses bank 1 and on- chip cpu accesses bank 0) 8 activate dmac assert hifdreq set dtrg bit to 1 9 consecutive data read from bank 1 in hifram write data to bank 0 in hifram 10 read from end address of bank 1 in hifram completes and operation halts hif bank interrupt occurs hifram bank switching by hif bank interrupt handler (external device accesses bank 0 and on- chip cpu accesses bank 1) 11 re-activate dmac assert hifdreq set dtrg bit to 1 12 consecutive data read from bank 0 in hifram write data to bank 1 in hifram 13 read from end address of bank 0 in hifram completes and operation halts hif bank interrupt occurs hifram bank switching by hif bank interrupt handler (external device accesses bank 1 and on- chip cpu accesses bank 0) 14 re-activate dmac assert hifdreq set dtrg bit to 1 hereafter no. 12 to 14 are repeated. when a regi ster other than hifdata is accessed (except that hifgsr read with hifrs = low), hifram c onsecutive read is interrupted, and no. 3 to 5 need to be done again.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 906 of 1262 rej09b0437-0100 20.8 alignment control tables 20.6 and 20.7 show the alignment contro l when an external device accesses the hifdata register, and the hif registers other th an the hifdata regi ster, respectively. table 20.6 hifdata register alignment for access by an external device data in hifdata wbswp bi t bo bit byte[1:0] bits alignment in hifd[15:0] pins 0 0 b'00 h'7654 b'10 h'3210 1 b'00 h'3210 b'10 h'7654 1 0 b'00 h'1032 b'10 h'5476 1 b'00 h'5476 h'76543210 b'10 h'1032 table 20.7 hif registers (other than hifd ata) alignment for access by an external device data in hifdata wbswp bi t bo bit byte[1:0] bits alignment in hifd[15:0] pins 0 b'00 h'7654 b'10 h'3210 1 b'00 h'3210 h'76543210 don't care b'10 h'7654
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 907 of 1262 rej09b0437-0100 20.9 interface when external device power is cut off when the power supply of an external device in terfacing with the hif is cut off, intermediate levels may be applied to the hif input pins or the hif output pins may drive an external device not powered, thus causing the device to be damaged. the hifebl pin is provided to prevent this from happening. the system power monitor block controls this pin in synchronization with the cutoff of the external device power so that all pins of this module excluding hifmd can be set to the high-impedance state. figure 20.11 shows an image of high-impedance control of the hif pins. table 20.8 lists the input/output control for the hif pins. hifcs hifwr hifrd hifd15 to hifd00 hifrs hifmd hifint hifdreq hifrdy hifebl figure 20.11 image of high-impedance control of hif pins by hifebl pin
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 908 of 1262 rej09b0437-0100 table 20.8 input/output control for hif pins lsi status reset state by res pin reset canceled by res pin hifmd input level high (boot setting) low (non-boot setting) the reset by the res pin is released while the hifmd signal is high. (boot mode established) the reset by the res pin is released while the hifmd signal is low (non-boot mode established) hifebl input level low high the hifebl pin is a general input port and the hif is not controlled by the signal input on this pin . low high general input port at the initial state * 1 hifrdy output control output buffer: on (low output) output buffer: on (low output) general input port output buffer: off output buffer: on (sequence output) general input port at the initial state * 2 hifint output control output buffer: off output buffer: off general input port output buffer: off output buffer: on (sequence output) general input port at the initial state * 2 hifdreq output control output buffer: off output buffer: off general input port output buffer: off output buffer: on (sequence output) general input port at the initial state * 2 hifd 15 to hifd0 i/o control i/o buffer: off i/o buffer: off general input port i/o buffer: off i/o buffer controlled according to states of hifcs , hifwr , and hifrd general input port at the initial state * 2 hifcs input control input buffer: off input buffer: off general input port input buffer: off input buffer: on general input port at the initial state * 2 hifrs input control input buffer: off input buffer: off general input port input buffer: off input buffer: on general input port at the initial state * 2
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 909 of 1262 rej09b0437-0100 lsi status reset state by res pin reset canceled by res pin hifmd input level high (boot setting) low (non-boot setting) high (after the reset canceled by boot setting) low (after the reset canceled by non-boot setting) hifebl input level low high the hifebl pin is a general input port and the hif is not controlled by the signal input on this pin. low high general input port at the initial state * 1 hifwr input control input buffer: off input buffer: off general input port input buffer: off input buffer: on general input port at the initial state * 2 hifrd input control input buffer: off input buffer: off general input port input buffer: off input buffer: on general input port at the initial state * 2 notes: 1. the pin also functions as an hifebl pin by setting the pfc registers. 2. the pin also functions as an hif pin by setting the pfc registers. when the hif pin function is selected for the hifebl pin and this pin by setting the pfc registers, the input and/or output buffers are controlled according to the hifebl pin state. when the hif pin function is not selected for the hifebl pin and is selected for this pin by setting the pfc registers, the input and/or output buffers are always turned off. this setting is prohibited.
section 20 host interface (hif) rev. 1.00 nov. 14, 2007 page 910 of 1262 rej09b0437-0100
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 911 of 1262 rej09b0437-0100 section 21 compare match timer (cmt) this lsi has an on-chip compare match timer (cmt) consisting of a two-channel 16-bit timer. the cmt has a16-bit counter, and can generate interrupts at set intervals. 21.1 features ? independent selection of four counter input clocks at two channels any of four internal clocks (p /8, p /32, p /128, and p /512) can be selected. ? selection of dma transfer request or interrupt request generation on compare match by dmac setting ? when not in use, the cmt can be stopped by halting its clock supply to reduce power consumption. figure 21.1 shows a block diagram of cmt. peripheral bus bus interface control circuit clock selection cmstr cmcsr_0 cmcor_0 comparator cmcnt_0 module bus channel 0 channel 1 cmt cmi0 p /8 p /32 p /128 p /512 cmi1 cmstr: cmcsr: cmcor: cmcnt: cmi: comrare mach timer start register comrare mach timer control/status register comrare mach constant register comrare mach counter comrare mach interrupt control circuit clock selection cmcsr_1 cmcor_1 comparator cmcnt_1 p /8 p /32 p /128 p /512 [legend] figure 21.1 block diagram of cmt
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 912 of 1262 rej09b0437-0100 21.2 register descriptions the cmt has the following registers. table 21.1 register configuration channel register name abbreviation r/w initial value address access size common compare match timer start register cmstr r/w h'0000 h'fffec000 16 compare match timer control/ status register_0 cmcsr_0 r/(w) * h'0000 h'fffec002 16 compare match counter_0 cmcnt_0 r/w h'0000 h'fffec004 8, 16 0 compare match constant register_0 cmcor_0 r/w h'ffff h'fffec006 8, 16 compare match timer control/ status register_1 cmcsr_1 r/(w) * h'0000 h'fffec008 16 compare match counter_1 cmcnt_1 r/w h'0000 h'fffec00a 8, 16 1 compare match constant register_1 cmcor_1 r/w h'ffff h'fffec00c 8, 16
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 913 of 1262 rej09b0437-0100 21.2.1 compare match tim er start register (cmstr) cmstr is a 16-bit register that selects whether compare match counter (cmcnt) operates or is stopped. cmstr is initialized to h'0000 by a power-on reset or in software standby mode, but retains its previous value in module standby mode. bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrr/wr/w ---- --- - ------ str1 str0 bit bit name initial value r/w description 15 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 str1 0 r/w count start 1 specifies whether compare match counter_1 operates or is stopped. 0: cmcnt_1 count is stopped 1: cmcnt_1 count is started 0 str0 0 r/w count start 0 specifies whether compare match counter_0 operates or is stopped. 0: cmcnt_0 count is stopped 1: cmcnt_0 count is started
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 914 of 1262 rej09b0437-0100 21.2.2 compare match timer co ntrol/status register (cmcsr) cmcsr is a 16-bit register that indicates co mpare match generation, enables or disables interrupts, and selects the counter input clock. cmcsr is initialized to h'0000 by a power-on reset or in software standby mode, but retains its previous value in module standby mode. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r r r r r r/(w) * r/w r r r r r/w r/w bit: initial value: r/w: note: only 0 can be written to clear the flag after 1 is read. * - - - - - - - - cmf cmie - - - - cks[1:0] bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 cmf 0 r/(w) * compare match flag indicates whether or not the values of cmcnt and cmcor match. 0: cmcnt and cmcor values do not match [clearing condition] ? when 0 is written to cmf after reading cmf = 1 1: cmcnt and cmcor values match 6 cmie 0 r/w compare match interrupt enable enables or disables compare match interrupt (cmi) generation when cmcnt and cmcor values match (cmf = 1). 0: compare match interrupt (cmi) disabled 1: compare match interrupt (cmi) enabled 5 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 915 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1, 0 cks[1:0] 00 r/w clock select these bits select the clock to be input to cmcnt from four internal clocks obtained by dividing the peripheral clock (p ). when the str bit in cmstr is set to 1, cmcnt starts counting on the clock selected with bits cks[1:0]. 00: p /8 01: p /32 10: p /128 11: p /512 note: * only 0 can be written to clear the flag after 1 is read.
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 916 of 1262 rej09b0437-0100 21.2.3 compare matc h counter (cmcnt) cmcnt is a 16-bit register used as an up-counter. when the counter input clock is selected with bits cks[1:0] in cmcsr, and the str bit in cm str is set to 1, cmcnt starts counting using the selected clock. when the value in cmcnt an d the value in compare match constant register (cmcor) match, cmcnt is cleared to h'0000 and the cmf flag in cmcsr is set to 1. cmcnt is initialized to h'0000 by a power-on reset or in software standby mode, but retains its previous value in module standby mode. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: 21.2.4 compare match co nstant register (cmcor) cmcor is a 16-bit register that sets the interval up to a compare match with cmcnt. cmcor is initialized to h'ffff by a power-on reset or in software standby mode, but retains its previous value in module standby mode. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1111111111111111 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w:
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 917 of 1262 rej09b0437-0100 21.3 operation 21.3.1 interval count operation when an internal clock is selected with the cks[1:0] bits in cmcsr and the str bit in cmstr is set to 1, cmcnt starts incrementing using the selected clock. when the values in cmcnt and cmcor match, cmcnt is cleared to h'0000 and the cmf flag in cmcsr is set to 1. when the cmie bit in cmcsr is set to 1 at this time , a compare match interrupt (cmi) is requested. cmcnt then starts counting up again from h'0000. figure 21.2 shows the operatio n of the compare match counter. cmcor h'0000 cmcnt value time counter cleared by compare match with cmcor figure 21.2 counter operation 21.3.2 cmcnt count timing one of four clocks (p /8, p /32, p /128, and p /512) obtained by dividing the peripheral clock (p ) can be selected with the cks[1:0] bits in cmcsr. figure 21.3 shows the timing. cmcnt n n + 1 peripheral clock (p ) clock n clock n + 1 internal clock count clock figure 21.3 count timing
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 918 of 1262 rej09b0437-0100 21.4 interrupts 21.4.1 interrupt sources and dma transfer requests the cmt has channels and each of them to which a different vect or address is allocated has a compare match interrupt. when both the compare match flag (cmf) and the interrupt enable bit (cmie) are set to 1, the corresponding interrupt request is output. when the interrupt is used to activate a cpu interrupt, the priority of channe ls can be changed by the interrupt controller settings. for details, see section 6, interrupt controller (intc). clear the cmf bit to 0 by the user exception handli ng routine. if this oper ation is not carried out, another interrupt will be generated. the direct memory access controller (dmac) can be set to be activated when a compare match inte rrupt is requested. in this case, an interrupt is not issued to the cpu. if the setting to activate the dmac has not been made, an interrupt request is sent to the cpu. the cmf bit is automatically cleared to 0 when data is transferred by the dmac. 21.4.2 timing of compare match flag setting when cmcor and cmcnt match, a compare match signal is generated at the last state in which the values match (the timing when the cmcnt value is updated to h'0000) and the cmf bit in cmcsr is set to 1. that is, after a match between cmcor and cmcnt, the compare match signal is not generated until the next cmcnt counter clock input. figure 21.4 shows the timing of cmf bit setting.
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 919 of 1262 rej09b0437-0100 cmcnt cmcor n n 0 peripheral clock (p ) counter clock compare match signal clock n + 1 figure 21.4 timing of cmf setting 21.4.3 timing of compare match flag clearing the cmf bit in cmcsr is cleared by first, reading as 1 then writin g to 0. however, in the case of the dmac being activated, the cmf bit is automatically cleared to 0 when data is transferred by the dmac.
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 920 of 1262 rej09b0437-0100 21.5 usage notes 21.5.1 conflict between write and compare-match processes of cmcnt when the compare match signal is generated in the t2 cycle while writing to cmcnt, clearing cmcnt has priority over writing to it. in this case, cmcnt is not written to. figure 21.5 shows the timing to clear the cmcnt counter. cmcnt t1 t2 cmcnt h'0000 n peripheral clock (p ) address signal internal write signal counter clear signal cmcsr write cycle figure 21.5 conflict between write and compare match processes of cmcnt
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 921 of 1262 rej09b0437-0100 21.5.2 conflict between word-write and count-up processes of cmcnt even when the count-up occurs in the t2 cycle while writing to cmcnt in words, the writing has priority over the count-up. in this case, the count-up is not performed. figure 21.6 shows the timing to write to cmcnt in words. cmcnt t1 t2 cmcnt m n peripheral clock (p ) address signal internal write signal cmcnt count-up enable signal cmcsr write cycle figure 21.6 conflict between word-wri te and count-up processes of cmcnt
section 21 compare match timer (cmt) rev. 1.00 nov. 14, 2007 page 922 of 1262 rej09b0437-0100 21.5.3 conflict between byte-write and count-up processes of cmcnt even when the count-up occurs in the t2 cycle while writing to cmcnt in bytes, the writing has priority over the count-up. in this case, the count-up is not performed. the byte data on the other side, which is not written to, is also not counted and the previous contents are retained. figure 21.7 shows the timing when the count-up occurs in the t2 cycle while writing to cmcnth in bytes. cmcnth t1 t2 cmcnth m n cmcntl x x peripheral clock (p ) address signal internal write signal cmcnt count-up enable signal cmcsr write cycle figure 21.7 conflict between byte-w rite and count-up processes of cmcnt 21.5.4 compare match between cmcnt and cmcor do not set a same value to cmcnt and cmcor while the count operation of cmcnt is stopped.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 923 of 1262 rej09b0437-0100 section 22 serial communi cation interface with fifo (scif) this lsi has a three-channel serial communication interface with fifo (scif) that supports both asynchronous and clocked synchronous serial communication. it also has 16-stage fifo registers for both transmission and reception independently for each channel that enable this lsi to perform efficient high-speed co ntinuous communication. 22.1 features ? asynchronous serial communication: ? serial data communication is performed by st art-stop in character units. the scif can communicate with a un iversal asynchronous receiver/tran smitter (uart), an asynchronous communication interface adapter (acia), or any other communications chip that employs a standard asynchronous seri al system. there are eight selectable serial data communication formats. ? data length: 7 or 8 bits ? stop bit length: 1 or 2 bits ? parity: even, odd, or none ? receive error detection: parity , framing, and overrun errors ? break detection: break is detected when a fram ing error is followed by at least one frame at the space 0 level (low level). it is also detect ed by reading the rxd level directly from the serial port register when a framing error occurs. ? clocked synchronous serial communication: ? serial data communication is synchronized w ith a clock signal. the scif can communicate with other chips having a clocked synchronous communication function. there is one serial data communication format. ? data length: 8 bits ? receive error detecti on: overrun errors ? full duplex communication: the transmitting and r eceiving sections are independent, so the scif can transmit and receive simultaneously. bo th sections use 16-stage fifo buffering, so high-speed continuous data transfer is possible in both the transmit and receive directions. ? on-chip baud rate generator with selectable bit rates ? internal or external tr ansmit/receive clock source: from either baud rate generator (internal) or sck pin (external)
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 924 of 1262 rej09b0437-0100 ? four types of interrupts: tran smit-fifo-data-empty interrupt, break interrupt, receive-fifo- data-full interrupt, and receive-error in terrupts are requested independently. ? when the scif is not in use, it can be stopped by halting the clock supplied to it, saving power. ? in asynchronous mode, on-chip modem control functions ( rts and cts ). ? the quantity of data in the transmit and receive fifo data re gisters and the number of receive errors of the receive data in the receive fifo data register can be ascertained. ? a time-out error (dr) can be detected when receiving in asynchronous mode. figure 22.1 shows a block diagram of the scif. p scfrdr (16 stage) scftdr (16 stage) scrsr sctsr scsmr sclsr scfdr scfcr scfsr scscr scsptr scbrr txi rxi eri bri p /4 p /16 p /64 rts cts sck txd rxd scif module data bus parity generation parity check transmission/reception control baud rate generator clock external clock bus interface peripheral bus scrsr: scfrdr: sctsr: scftdr: scsmr: scscr: [legend] scfsr: scbrr: scsptr: scfcr: scfdr: sclsr: receive shift register receive fifo data register transmit shift register transmit fifo data register serial mode register serial control register serial status register bit rate register serial port register fifo control register fifo data count set register line status register figure 22.1 block diagram of scif
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 925 of 1262 rej09b0437-0100 22.2 input/output pins table 22.1 shows the pin configuration of the scif. table 22.1 pin configuration channel pin name symbol i/o function serial clock pins sc k0 to sck2 i/o clock i/o receive data pins rxd0 to rx d2 input receive data input transmit data pins txd0 to tx d2 output transmit data output request to send pin rts0 to rts2 i/o request to send 0 to 2 clear to send pin cts0 to cts2 i/o clear to send
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 926 of 1262 rej09b0437-0100 22.3 register descriptions the scif has the following registers. table 22.2 register configuration channel register name abbreviation r/w initial value address access size serial mode register_0 scsmr_0 r/w h'0000 h'fffe8000 16 bit rate register_0 scbrr_0 r/w h'ff h'fffe8004 8 serial control register_0 scscr_0 r/w h'0000 h'fffe8008 16 transmit fifo data register_0 scftdr_0 w undefined h'fffe800c 8 serial status register_0 scfsr_0 r/(w) * 1 h'0060 h'fffe8010 16 receive fifo data register_0 scfrdr_0 r undefined h'fffe8014 8 fifo control register_0 scfcr_0 r/w h'0000 h'fffe8018 16 fifo data count register_0 scfdr_0 r h'0000 h'fffe801c 16 serial port register_0 scsptr_0 r/w h'0050 h'fffe8020 16 0 line status register_0 sclsr_0 r/(w) * 2 h'0000 h'fffe8024 16 serial mode register_1 scsmr_1 r/w h'0000 h'fffe8800 16 bit rate register_1 scbrr_1 r/w h'ff h'fffe8804 8 serial control register_1 scscr_1 r/w h'0000 h'fffe8808 16 transmit fifo data register_1 scftdr_1 w undefined h'fffe880c 8 serial status register_1 scfsr_1 r/(w) * 1 h'0060 h'fffe8810 16 receive fifo data register_1 scfrdr_1 r undefined h'fffe8814 8 fifo control register_1 scfcr_1 r/w h'0000 h'fffe8818 16 fifo data count register_1 scfdr_1 r h'0000 h'fffe881c 16 serial port register_1 scsptr_1 r/w h'0050 h'fffe8820 16 1 line status register_1 sclsr_1 r/(w) * 2 h'0000 h'fffe8824 16
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 927 of 1262 rej09b0437-0100 channel register name abbreviation r/w initial value address access size serial mode register_2 scsmr_2 r/w h'0000 h'fffe9000 16 bit rate register_2 scbrr_2 r/w h'ff h'fffe9004 8 serial control register_2 scscr_2 r/w h'0000 h'fffe9008 16 transmit fifo data register_2 scftdr_2 w undefined h'fffe900c 8 serial status register_2 scfsr_2 r/(w) * 1 h'0060 h'fffe9010 16 receive fifo data register_2 scfrdr_2 r undefined h'fffe9014 8 fifo control register_2 scfcr_2 r/w h'0000 h'fffe9018 16 fifo data count register_2 scfdr_2 r h'0000 h'fffe901c 16 serial port register_2 scsptr_2 r/w h'0050 h'fffe9020 16 2 line status register_2 sclsr_2 r/(w) * 2 h'0000 h'fffe9024 16 notes: 1. only 0 can be written to clear the flag. bits 15 to 8, 3, and 2 are read-only bits that cannot be modified. 2. only 0 can be written to clear the flag. bits 15 to 1 are read-only bits that cannot be modified.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 928 of 1262 rej09b0437-0100 22.3.1 receive shift register (scrsr) scrsr receives serial data. data input at the rxd pin is loaded into scrsr in the order received, lsb (bit 0) first, converting the da ta to parallel form. when one byte has been received, it is automatically transferred to the recei ve fifo data register (scfrdr). the cpu cannot read or write to scrsr directly. 7654321 0 -------- -------- bit: initial value: r/w: 22.3.2 receive fifo da ta register (scfrdr) scfrdr is a 16-byte fifo regist er that stores serial receive data. the scif completes the reception of one byte of serial da ta by moving the received data from the receive shift register (scrsr) into scfrdr for storage. continuous reception is possible until 16 bytes are stored. the cpu can read but not write to scfrdr. if data is read when there is no receive data in the scfrdr, the value is undefined. when scfrdr is full of receive data, subsequent serial data is lost. scfrdr is initialized to an undefined value by a power-on reset. 7654321 0 -------- rrrrrrrr bit: initial value: r/w:
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 929 of 1262 rej09b0437-0100 22.3.3 transmit shift register (sctsr) sctsr transmits serial data. the scif loads transm it data from the transmit fifo data register (scftdr) into sctsr, then transmits the data seri ally from the txd pin, lsb (bit 0) first. after transmitting one data byte, the scif automatically loads the next transmit data from scftdr into sctsr and starts transmitting again. the cpu cannot read or write to sctsr directly. 7654321 0 -------- -------- bit: initial value: r/w: 22.3.4 transmit fifo data register (scftdr) scftdr is a 16-byte fifo register that stores data for serial tr ansmission. when the scif detects that the transmit shift register (sctsr) is empt y, it moves transmit data written in the scftdr into sctsr and starts serial tran smission. continuous serial transm ission is performed until there is no transmit data left in scftdr. the cpu can write to scftdr at all times. when scftdr is full of transmit data (16 bytes), no more data can be written. if writing of new data is attempted, the data is ignored. scftdr is initialized to an undefined value by a power-on reset. 7654321 0 -------- wwwwwwww bit: initial value: r/w:
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 930 of 1262 rej09b0437-0100 22.3.5 serial mode register (scsmr) scsmr specifies the scif serial communication fo rmat and selects the clock source for the baud rate generator. the cpu can always read and write to scsmr. scsmr is initialized to h'0000 by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r r r r r r/w r/w r/w r/w r/w r r/w r/w bit: initial value: r/w: --------c/ a chr pe o/ e stop - cks[1:0] bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 c/ a 0 r/w communication mode selects whether the scif oper ates in asynchronous or clocked synchronous mode. 0: asynchronous mode 1: clocked synchronous mode 6 chr 0 r/w character length selects 7-bit or 8-bit data length in asynchronous mode. in the clocked synchronous mode, the data length is always 8 bits, regardless of the chr setting. 0: 8-bit data 1: 7-bit data * note: * when 7-bit data is selected, the msb (bit 7) of the transmit fifo data register is not transmitted.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 931 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 pe 0 r/w parity enable selects whether to add a parity bit to transmit data and to check the parity of receive data, in asynchronous mode. in clocked synchronous mode, a parity bit is neither added nor checked, regardless of the pe setting. 0: parity bit not added or checked 1: parity bit added and checked * note: * when pe is set to 1, an even or odd parity bit is added to transmit data, depending on the parity mode (o/ e ) setting. receive data parity is checked according to the even/odd (o/ e ) mode setting. 4 o/ e 0 r/w parity mode selects even or odd parity when parity bits are added and checked. the o/ e setting is used only in asynchronous mode and only when the parity enable bit (pe) is set to 1 to enable parity addition and checking. the o/ e setting is ignored in clocked synchronous mode, or in asynchronous mode when parity addition and checking is disabled. 0: even parity * 1 1: odd parity * 2 notes: 1. if even parity is selected, the parity bit is added to transmit data to make an even number of 1s in the transmitted character and parity bit combined. receive data is checked to see if it has an even number of 1s in the received character and parity bit combined. 2. if odd parity is selected, the parity bit is added to transmit data to make an odd number of 1s in the transmitted character and parity bit combined. receive data is checked to see if it has an odd number of 1s in the received character and parity bit combined.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 932 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 stop 0 r/w stop bit length selects one or two bits as the stop bit length in asynchronous mode. this setting is used only in asynchronous mode. it is ignored in clocked synchronous mode because no stop bits are added. when receiving, only the first stop bit is checked, regardless of the stop bit setting. if the second stop bit is 1, it is treated as a stop bit, but if the second stop bit is 0, it is treated as the start bit of the next incoming character. 0: one stop bit when transmitting, a single 1-bit is added at the end of each transmitted character. 1: two stop bits when transmitting, two 1 bits are added at the end of each transmitted character. 2 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 1, 0 cks[1:0] 00 r/w clock select select the internal clock source of the on-chip baud rate generator. for further information on the clock source, bit rate register settings, and baud rate, see section 22.3.8, bit rate register (scbrr). 00: p 01: p /4 10: p /16 11: p /64 note: p : peripheral clock
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 933 of 1262 rej09b0437-0100 22.3.6 serial control register (scscr) scscr operates the scif transmitte r/receiver, enables/disables interrupt requests, and selects the transmit/receive clock source. th e cpu can always read and write to scscr. scscr is initialized to h'0000 by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r r r r r r/w r/w r/w r/w r/w r r/w r/w bit: initial value: r/w: - - - - - - - - tie rie te re reie - cke[1:0] bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 tie 0 r/w transmit interrupt enable enables or disables the transmit-fifo-data-empty interrupt (txi) requested when the serial transmit data is transferred from the transmit fifo data register (scftdr) to the transmit shift register (sctsr), when the quantity of data in t he transmit fifo register becomes less than the specified number of transmission triggers, and when the tdfe flag in the serial status register (scfsr) is set to1. 0: transmit-fifo-data-empty interrupt request (txi) is disabled 1: transmit-fifo-data-empty interrupt request (txi) is enabled * note: * the txi interrupt request can be cleared by writing a greater quantit y of transmit data than the specified transmission trigger number to scftdr and by clearing tdfe to 0 after reading 1 from tdfe, or can be cleared by clearing tie to 0.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 934 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 rie 0 r/w receive interrupt enable enables or disables the receive fifo data full (rxi) interrupts requested when the rdf flag or dr flag in serial status register (scfsr ) is set to1, receive-error (eri) interrupts requested when the er flag in scfsr is set to1, and break (bri) interrupts requested when the brk flag in scfsr or the orer flag in line status register (sclsr) is set to1. 0: receive fifo data full inte rrupt (rxi), receive-error interrupt (eri), and break interrupt (bri) requests are disabled 1: receive fifo data full inte rrupt (rxi), receive-error interrupt (eri), and break interrupt (bri) requests are enabled * note: * rxi interrupt requests can be cleared by reading the dr or rdf flag after it has been set to 1, then clearing the flag to 0, or by clearing rie to 0. eri or bri interrupt requests can be cleared by reading the er, br or orer flag after it has been set to 1, then clearing the flag to 0, or by clearing rie and reie to 0. 5 te 0 r/w transmit enable enables or disables the serial transmitter. 0: transmitter disabled 1: transmitter enabled * note: * serial transmission starts after writing of transmit data into scftdr. select the transmit format in scsmr and scfcr and reset the transmit fifo before setting te to 1.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 935 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 re 0 r/w receive enable enables or disables the serial receiver. 0: receiver disabled * 1 1: receiver enabled * 2 notes: 1. clearing re to 0 does not affect the receive flags (dr, er, brk, rdf, fer, per, and orer). these flags retain their previous values. 2. serial reception starts when a start bit is detected in asynchronous mode, or synchronous clock is detected in clocked synchronous mode. select the receive format in scsmr and scfcr and reset the receive fifo before setting re to 1. 3 reie 0 r/w receive error interrupt enable enables or disables the receive-error (eri) interrupts and break (bri) interrupts. the setting of reie bit is valid only when rie bit is set to 0. 0: receive-error interrupt (eri) and break interrupt (bri) requests are disabled 1: receive-error interrupt (eri) and break interrupt (bri) requests are enabled * note: * eri or bri interrupt requests can be cleared by reading the er, br or orer flag after it has been set to 1, then clearing the flag to 0, or by clearing rie and reie to 0. even if rie is set to 0, when reie is set to 1, eri or bri interrupt requests are enabled. set so if scif wants to inform intc of eri or bri interrupt requests during dma transfer.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 936 of 1262 rej09b0437-0100 bit bit name initial value r/w description 2 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 1, 0 cke[1:0] 00 r/w clock enable select the scif clock source and enable or disable clock output from the sck pin. depending on cke[1:0], the sck pin can be used for serial clock output or serial clock input. if serial clock output is set in clocked synchronous mode, set the c/ a bit in scsmr to 1, and then set cke[1:0]. ? asynchronous mode 00: internal clock, sck pin used for input pin (input signal is ignored) 01: internal clock, sck pin used for clock output ( the output clock frequency is 16 times the bit rate. ) 10: external clock, sck pin used for clock input ( the input clock frequency is 16 times the bit rate. ) 11: setting prohibited ? clocked synchronous mode 00: internal clock, sck pin used for serial clock output 01: internal clock, sck pin used for serial clock output 10: external clock, sck pin used for serial clock input 11: setting prohibited
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 937 of 1262 rej09b0437-0100 22.3.7 serial status register (scfsr) scfsr is a 16-bit register. the upper 8 bits indi cate the number of receive errors in the receive fifo data register, and the lower 8 bits indicate the status flag indicating scif operating state. the cpu can always read and write to scfsr, but cannot write 1 to the st atus flags (er, tend, tdfe, brk, rdf, and dr). these fl ags can be cleared to 0 only if they have first been read (after being set to 1). bits 3 (fer) and 2 (per) are read-only bits that cannot be written. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000001100000 r r r r r r r r r/(w) * r/(w) * r/(w) * r/(w) * r r r/(w) * r/(w) * bit: initial value: r/w: note: only 0 can be written to clear the flag after 1 is read. * per[3:0] fer[3:0] er tend tdfe brk fer per rdf dr bit bit name initial value r/w description 15 to 12 per[3:0] 0000 r number of parity errors indicate the quantity of data including a parity error in the receive data stored in the receive fifo data register (scfrdr). the value indicated by bits 15 to 12 after the er bit in scfsr is set, represents the number of parity errors in scfrdr. when parity errors have occurred in all 16-byte receive data in scfrdr, per[3:0] shows 0000. 11 to 8 fer[3:0] 0000 r number of framing errors indicate the quantity of dat a including a framing error in the receive data stored in scfrdr. the value indicated by bits 11 to 8 after the er bit in scfsr is set, represents the number of framing errors in scfrdr. when framing errors have occurred in all 16-byte receive data in scfrdr, fer[3:0] shows 0000.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 938 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 er 0 r/(w) * receive error indicates the occurrence of a framing error, or of a parity error when receiving data that includes parity. * 1 0: receiving is in progress or has ended normally [clearing conditions] ? er is cleared to 0 a power-on reset ? er is cleared to 0 when the chip is when 0 is written after 1 is read from er 1: a framing error or parity error has occurred. [setting conditions] ? er is set to 1 when the stop bit is 0 after checking whether or not the last stop bit of the received data is 1 at the end of one data receive operation * 2 ? er is set to 1 when the total number of 1s in the receive data plus parity bit does not match the even/odd parity specified by the o/ e bit in scsmr notes: 1. clearing the re bit to 0 in scscr does not affect the er bit, which retains its previous value. even if a receive error occurs, the receive data is transferred to scfrdr and the receive operation is continued. whether or not the data read from scfrdr includes a receive error can be detected by the fer and per bits in scfsr. 2. in two stop bits mode, only the first stop bit is checked; the second stop bit is not checked.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 939 of 1262 rej09b0437-0100 bit bit name initial value r/w description 6 tend 1 r/(w) * transmit end indicates that when the last bit of a serial character was transmitted, scftdr did not contain valid data, so transmission has ended. 0: transmission is in progress [clearing condition] ? tend is cleared to 0 when 0 is written after 1 is read from tend after transmit data is written in scftdr * 1 1: end of transmission [setting conditions] ? tend is set to 1 when the chip is a power-on reset ? tend is set to 1 when te is cleared to 0 in the serial control register (scscr) ? tend is set to 1 when scftdr does not contain receive data when the last bit of a one-byte serial character is transmitted note: 1. do not use this bit as a transmit end flag when the dmac writes data to scftdr due to a txi interrupt request.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 940 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 tdfe 1 r/(w) * transmit fifo data empty indicates that data has been transferred from the transmit fifo data register (scftdr) to the transmit shift register (sctsr), the quantity of data in scftdr has become less than the transmission trigger number specified by the ttrg[1:0] bits in the fifo control register (scfcr), and writing of transmit data to scftdr is enabled. 0: the quantity of transmit data written to scftdr is greater than the specified transmission trigger number [clearing conditions] ? tdfe is cleared to 0 when data exceeding the specified transmission trigger number is written to scftdr after 1 is read from tdfe and then 0 is written ? tdfe is cleared to 0 when dmac is activated by transmit fifo data empty interrupt (txi) and write data exceeding the specified transmission trigger number to scftdr 1: the quantity of transmi t data in scftdr is less than or equal to the specified transmission trigger number * 1 [setting conditions] ? tdfe is set to 1 by a power-on reset ? tdfe is set to 1 when the quantity of transmit data in scftdr becomes less than or equal to the specified transmission trigger number as a result of transmission note: 1. since scftdr is a 16-byte fifo register, the maximum quantity of data that can be written when tdfe is 1 is "16 minus the specified transmission trigger number". if an attempt is made to write additional data, the data is ignored. the quantity of data in scftdr is indicated by the upper 8 bits of scfdr.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 941 of 1262 rej09b0437-0100 bit bit name initial value r/w description 4 brk 0 r/(w) * break detection indicates that a break signal has been detected in receive data. 0: no break signal received [clearing conditions] ? brk is cleared to 0 when the chip is a power-on reset ? brk is cleared to 0 when software reads brk after it has been set to 1, then writes 0 to brk 1: break signal received * 1 [setting condition] ? brk is set to 1 when data including a framing error is received, and a framing error occurs with space 0 in the subsequent receive data note: 1. when a break is detected, transfer of the receive data (h'00) to scfrdr stops after detection. when the break ends and the receive signal becomes mark 1, the transfer of receive data resumes. 3 fer 0 r framing error indication indicates a framing error in the data read from the next receive fifo data register (scfrdr) in asynchronous mode. 0: no receive framing error occurred in the next data read from scfrdr [clearing conditions] ? fer is cleared to 0 when the chip undergoes a power-on reset ? fer is cleared to 0 when no framing error is present in the next data read from scfrdr 1: a receive framing error occurred in the next data read from scfrdr. [setting condition] ? fer is set to 1 when a framing error is present in the next data read from scfrdr
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 942 of 1262 rej09b0437-0100 bit bit name initial value r/w description 2 per 0 r parity error indication indicates a parity error in the data read from the next receive fifo data register (scfrdr) in asynchronous mode. 0: no receive parity error occurred in the next data read from scfrdr [clearing conditions] ? per is cleared to 0 when the chip undergoes a power-on reset ? per is cleared to 0 when no parity error is present in the next data read from scfrdr 1: a receive parity error occurred in the next data read from scfrdr [setting condition] ? per is set to 1 when a parity error is present in the next data read from scfrdr
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 943 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1 rdf 0 r/(w) * receive fifo data full indicates that receive data has been transferred to the receive fifo data register (scfrdr), and the quantity of data in scf rdr has become more than the receive trigger number specified by the rtrg[1:0] bits in the fifo control register (scfcr). 0: the quantity of transmit data written to scfrdr is less than the specified receive trigger number [clearing conditions] ? rdf is cleared to 0 by a power-on reset, standby mode ? rdf is cleared to 0 when the scfrdr is read until the quantity of receive data in scfrdr becomes less than the specified receive trigger number after 1 is read from rdf and then 0 is written ? rdf is cleared to 0 when dmac is activated by receive fifo data full interrupt (rxi) and read scfrdr until the quantit y of receive data in scfrdr becomes less than the specified receive trigger number 1: the quantity of receiv e data in scfrdr is more than the specified receive trigger number [setting condition] ? rdf is set to 1 when a quantity of receive data more than the specified receive trigger number is stored in scfrdr * 1 note: 1. as scftdr is a 16-byte fifo register, the maximum quantity of data that can be read when rdf is 1 becomes the specified receive trigger number. if an attempt is made to read after all the data in scfrdr has been read, the data is undefined. the quantity of receive data in scfrdr is indicated by the lower 8 bits of scfdr.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 944 of 1262 rej09b0437-0100 bit bit name initial value r/w description 0 dr 0 r/(w) * receive data ready indicates that the quantity of data in the receive fifo data register (scfrdr) is less than the specified receive trigger number, and that the next data has not yet been received after the elapse of 15 etu from the last stop bit in asynchronous mode. in clocked synchronous mode, this bit is not set to 1. 0: receiving is in progress, or no receive data remains in scfrdr after receiving ended normally [clearing conditions] ? dr is cleared to 0 when the chip undergoes a power-on reset ? dr is cleared to 0 when all receive data are read after 1 is read from dr and then 0 is written. ? dr is cleared to 0 when all receive data are read after dmac is activated by receive fifo data full interrupt (rxi). 1: next receive data has not been received [setting condition] ? dr is set to 1 when scfrdr contains less data than the specified receiv e trigger number, and the next data has not yet been received after the elapse of 15 etu from the last stop bit. * 1 note: 1. this is equivalent to 1.5 frames with the 8-bit, 1-stop-bit format. (etu: elementary time unit) note: * only 0 can be written to clear the flag after 1 is read.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 945 of 1262 rej09b0437-0100 22.3.8 bit rate register (scbrr) scbrr is an 8-bit register that, together with the baud rate generator clock source selected by the cks[1:0] bits in the serial mode register (scsmr), determines th e serial transmit/receive bit rate. the cpu can always read and write to scbrr. s cbrr is initialized to h'ff by a power-on reset. each channel has independent baud rate generator control, so different values can be set in three channels. 7654321 0 11111111 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: the scbrr setting is calculated as follows: ? asynchronous mode: n = 10 6 ? 1 64 2 2n-1 b p ? clocked synchronous mode: n = 10 6 ? 1 8 2 2n-1 b p b: bit rate (bits/s) n: scbrr setting for baud rate generator (0 n 255) (the setting must satisfy the electrical characteristics.) p : operating frequency for peripheral modules (mhz) n: baud rate generator clock source (n = 0, 1, 2, 3) (for the clock sources and values of n, see table 22.3.)
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 946 of 1262 rej09b0437-0100 table 22.3 scsmr settings scsmr settings n clock source cks[1] cks[0] 0 p 0 0 1 p /4 0 1 2 p /16 1 0 3 p /64 1 1 the bit rate error in asynchronous is given by the following formula: error (%) = ? 1 100 (n + 1) b 64 2 2n-1 p 10 6 table 22.4 lists examples of scbrr settings in asynchronous mode, and table 22.5 lists examples of scbrr settings in clocked synchronous mode. table 22.4 bit rates and scbrr settings (asynchronous mode) p (mhz) 5 6 6.144 bit rate (bit/s) n n error ( % ) n n error ( % ) n n error ( % ) 110 2 88 ? 0.25 2 106 ? 0.44 2 108 0.08 150 2 64 0.16 2 77 0.16 2 79 0.00 300 1 129 0.16 1 155 0.16 1 159 0.00 600 1 64 0.16 1 77 0.16 1 79 0.00 1200 0 129 0.16 0 155 0.16 0 159 0.00 2400 0 64 0.16 0 77 0.16 0 79 0.00 4800 0 32 ? 1.36 0 38 0.16 0 39 0.00 9600 0 15 1.73 0 19 ? 2.34 0 19 0.00 19200 0 7 1.73 0 9 ? 2.34 0 9 0.00 31250 0 4 0.00 0 5 0.00 0 5 2.40 38400 0 3 1.73 0 4 ? 2.34 0 4 0.00
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 947 of 1262 rej09b0437-0100 p (mhz) 7.3728 8 9.8304 bit rate (bit/s) n n error ( % ) n n error ( % ) n n error ( % ) 110 2 130 ?0.07 2 141 0.03 2 174 ?0.26 150 2 95 0.00 2 103 0.16 2 127 0.00 300 1 191 0.00 1 207 0.16 1 255 0.00 600 1 95 0.00 1 103 0.16 1 127 0.00 1200 0 191 0.00 0 207 0.16 0 255 0.00 2400 0 95 0.00 0 103 0.16 0 127 0.00 4800 0 47 0.00 0 51 0.16 0 63 0.00 9600 0 23 0.00 0 25 0.16 0 31 0.00 19200 0 11 0.00 0 12 0.16 0 15 0.00 31250 0 6 5.33 0 7 0.00 0 9 ?1.70 38400 0 5 0.00 0 6 ?6.99 0 7 0.00 p (mhz) 10 12 12.288 14.7456 bit rate (bit/s) n n error ( % ) n n error ( % ) n n error ( % ) n n error ( % ) 110 2 177 ?0.25 2 212 0.03 2 217 0.08 3 64 0.70 150 2 129 0.16 2 155 0.16 2 159 0.00 2 191 0.00 300 2 64 0.16 2 77 0.16 2 79 0.00 2 95 0.00 600 1 129 0.16 1 155 0.16 1 159 0.00 1 191 0.00 1200 1 64 0.16 1 77 0.16 1 79 0.00 1 95 0.00 2400 0 129 0.16 0 155 0.16 0 159 0.00 0 191 0.00 4800 0 64 0.16 0 77 0.16 0 79 0.00 0 95 0.00 9600 0 32 ?1.36 0 38 0.16 0 39 0.00 0 47 0.00 19200 0 15 1.73 0 19 0.16 0 19 0.00 0 23 0.00 31250 0 9 0.00 0 11 0.00 0 11 2.40 0 14 ?1.70 38400 0 7 1.73 0 9 ?2.34 0 9 0.00 0 11 0.00
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 948 of 1262 rej09b0437-0100 p (mhz) 16 19.6608 20 24 bit rate (bit/s) n n error ( % ) n n error ( % ) n n error ( % ) n n error ( % ) 110 3 70 0.03 3 86 0.31 3 88 ?0.25 3 106 ?0.44 150 2 207 0.16 2 255 0.00 3 64 0.16 3 77 0.16 300 2 103 0.16 2 127 0.00 2 129 0.16 2 155 0.16 600 1 207 0.16 1 255 0.00 2 64 0.16 2 77 0.16 1200 1 103 0.16 1 127 0.00 1 129 0.16 1 155 0.16 2400 0 207 0.16 0 255 0.00 1 64 0.16 1 77 0.16 4800 0 103 0.16 0 127 0.00 0 129 0.16 0 155 0.16 9600 0 51 0.16 0 63 0.00 0 64 0.16 0 77 0.16 19200 0 25 0.16 0 31 0.00 0 32 ?1.36 0 38 0.16 31250 0 15 0.00 0 19 ?1.70 0 19 0.00 0 23 0.00 38400 0 12 0.16 0 15 0.00 0 15 1.73 0 19 ?2.34 p (mhz) 24.576 28.7 30 33 bit rate (bit/s) n n error ( % ) n n error ( % ) n n error ( % ) n n error ( % ) 110 3 108 0.08 3 126 0.31 3 132 0.13 3 145 0.33 150 3 79 0.00 3 92 0.46 3 97 ?0.35 3 106 0.39 300 2 159 0.00 2 186 ?0.08 2 194 0.16 2 214 ?0.07 600 2 79 0.00 2 92 0.46 2 97 ?0.35 2 106 0.39 1200 1 159 0.00 1 186 ?0.08 1 194 0.16 1 214 ?0.07 2400 1 79 0.00 1 92 0.46 1 97 ?0.35 1 106 0.39 4800 0 159 0.00 0 186 ?0.08 0 194 ?1.36 0 214 ?0.07 9600 0 79 0.00 0 92 0.46 0 97 ?0.35 0 106 0.39 19200 0 39 0.00 0 46 ?0.61 0 48 ?0.35 0 53 ?0.54 31250 0 24 ?1.70 0 28 ?1.03 0 29 0.00 0 32 0.00 38400 0 19 0.00 0 22 1.55 0 23 1.73 0 26 ?0.54
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 949 of 1262 rej09b0437-0100 p (mhz) 50 bit rate (bit/s) n n error ( % ) 110 3 221 ?0.02 150 3 162 ?0.15 300 3 80 0.47 600 2 162 ?0.15 1200 2 80 0.47 2400 1 162 ?0.15 4800 1 80 0.47 9600 0 162 ?0.15 19200 0 80 0.47 31250 0 49 0.00 38400 0 40 ?0.76 note: settings with an error of 1% or less are recommended. table 22.5 bit rates and scbrr sett ings (clocked synchronous mode) p (mhz) 5 8 16 28.7 30 33 50 bit rate (bit/s) n n n n n n n n n n n n n n 110 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 250 3 77 3 124 3 249 ? ? ? ? ? ? ? ? 500 3 38 2 249 3 124 3 223 3 233 3 255 ? ? 1k 2 77 2 124 2 249 3 111 3 116 3 125 3 194 2.5k 1 124 1 199 2 99 2 178 2 187 2 200 3 77 5k 0 249 1 99 1 199 2 89 2 93 2 100 2 155 10k 0 124 0 199 1 99 1 178 1 187 1 200 2 77 25k 0 49 0 79 0 159 1 71 1 74 1 80 1 124 50k 0 24 0 39 0 79 0 143 0 149 0 160 0 249 100k ? ? 0 19 0 39 0 71 0 74 0 80 0 124 250k 0 4 0 7 0 15 ? ? 0 29 0 31 0 49 500k ? ? 0 3 0 7 ? ? 0 14 0 15 0 24 1m ? ? 0 1 0 3 ? ? ? ? 0 7 0 12 2m 0 0* 0 1 ? ? ? ? ? ? ? ?
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 950 of 1262 rej09b0437-0100 [legend] blank: no setting possible ?: setting possible, but error occurs * : continuous transmission/reception not possible table 22.6 indicates the maximum bit rates in asynchronous mode when the baud rate generator is used. table 22.7 lists the maximum bit rates in asynchronous mode when the external clock input is used. table 22.8 lists the maximum bit rates in clocked synchronous mode when the external clock input is used (when t scyc = 12t pcyc *). note: * make sure that the elect rical characteristics of this lsi and that of a connected lsi are satisfied. table 22.6 maximum bit rates for variou s frequencies with baud rate generator (asynchronous mode) settings p (mhz) maximum bit rate (bits/s) n n 5 156250 0 0 8 250000 0 0 9.8304 307200 0 0 12 375000 0 0 14.7456 460800 0 0 16 500000 0 0 19.6608 614400 0 0 20 625000 0 0 24 750000 0 0 24.576 768000 0 0 28.7 896875 0 0 30 937500 0 0 33 1031250 0 0 50 1562500 0 0
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 951 of 1262 rej09b0437-0100 table 22.7 maximum bit rates with external clock input (asynchronous mode) p (mhz) external input clock (mh z) maximum bit rate (bits/s) 5 1.2500 78125 8 2.0000 125000 9.8304 2.4576 153600 12 3.0000 187500 14.7456 3.6864 230400 16 4.0000 250000 19.6608 4.9152 307200 20 5.0000 312500 24 6.0000 375000 24.576 6.1440 384000 28.7 7.1750 448436 30 7.5000 468750 33 8.25 515625 50 12.5 781250 table 22.8 maximum bit rates with external clock input (clocked synchronous mode, t scyc = 12t pcyc ) p (mhz) external input clock (mh z) maximum bit rate (bits/s) 5 0.4166 416666.6 8 0.6666 666666.6 16 1.3333 1333333.3 24 2.0000 2000000.0 28.7 2.3916 2391666.6 30 2.5000 2500000.0 33 2.7500 2750000.0 50 4.1667 4166666.7
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 952 of 1262 rej09b0437-0100 22.3.9 fifo control register (scfcr) scfcr resets the quantity of data in the transmit and receive fifo data registers, sets the trigger data quantity, and contains an enable bit for loop-back testing. scfcr can always be read and written to by the cpu. it is initialized to h'0000 by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: ----- rstrg[2:0] rtrg[1:0] ttrg[1:0] mce tfrst rfrst loop bit bit name initial value r/w description 15 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 10 to 8 rstrg[2:0] 000 r/w rts output active trigger when the quantity of receive data in receive fifo data register (scfrdr) becomes more than the number shown below, rts signal is set to high. 000: 15 001: 1 010: 4 011: 6 100: 8 101: 10 110: 12 111: 14
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 953 of 1262 rej09b0437-0100 bit bit name initial value r/w description receive fifo data trigger set the quantity of receive data which sets the receive data full (rdf) flag in the serial status register (scfsr). the rdf flag is set to 1 when the quantity of receive data stored in the receive fi fo register (scfrdr) is increased more than the set trigger number shown below. ? asynchronous mode ? clocked synchronous mode 00: 1 01: 4 10: 8 11: 14 00: 1 01: 2 10: 8 11: 14 7, 6 rtrg[1:0] 00 r/w note: in clock synchronous mode, to transfer the receive data using dmac, set the receive trigger number to 1. if set to other than 1, cpu must read the receive data left in scfrdr. 5, 4 ttrg[1:0] 00 r/w trans mit fifo data trigger set the quantity of remaining transmit data which sets the transmit fifo data register empty (tdfe) flag in the serial status register (scfsr). the tdfe flag is set to 1 when the quantity of transmit data in the transmit fifo data register (scftdr) becomes less than the set trigger number shown below. 00: 8 (8) * 01: 4 (12) * 10: 2 (14) * 11: 0 (16) * note: * values in parentheses mean the number of empty bytes in scftdr when the tdfe flag is set to 1.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 954 of 1262 rej09b0437-0100 bit bit name initial value r/w description 3 mce 0 r/w modem control enable enables modem control signals cts and rts . in clocked synchronous mode, the mce bit should always be 0. 0: modem signal disabled * 1: modem signal enabled note: * cts is fixed at active 0 regardless of the input value, and rts is also fixed at 0. 2 tfrst 0 r/w transmit fifo data register reset disables the transmit data in the transmit fifo data register and resets the data to the empty state. 0: reset operation disabled * 1: reset operation enabled note: * reset operation is executed by a power-on reset. 1 rfrst 0 r/w receive fifo data register reset disables the receive data in the receive fifo data register and resets the data to the empty state. 0: reset operation disabled * 1: reset operation enabled note: * reset operation is executed by a power-on reset. 0 loop 0 r/w loop-back test internally connects the transmit output pin (txd) and receive input pin (rxd) and internally connects the rts pin and cts pin and enables loop-back testing. 0: loop back test disabled 1: loop back test enabled
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 955 of 1262 rej09b0437-0100 22.3.10 fifo data count set register (scfdr) scfdr is a 16-bit register which indicates the qu antity of data stored in the transmit fifo data register (scftdr) and the receive fifo data register (scfrdr). it indicates the quantity of transmit data in scftdr with the upper 8 bits, and the quantity of receive data in scfrdr with the lower 8 bits. sc fdr can always be read by the cpu. scfdr is initialized to h'0000 by a power on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr bit: initial value: r/w: - - - t[4:0] - - - r[4:0] bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 to 8 t[4:0] 00000 r t4 to t0 bits i ndicate the quantity of non-transmitted data stored in scftdr. h'00 means no transmit data, and h'10 means that scftdr is full of transmit data. 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 to 0 r[4:0] 00000 r r4 to r0 bits indicate the quantity of receive data stored in scfrdr. h'00 me ans no receive data, and h'10 means that scfrdr full of receive data.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 956 of 1262 rej09b0437-0100 22.3.11 serial port register (scsptr) scsptr controls input/output and data of pins multiplexed to scif function. bits 7 and 6 can control input/output data of rts pin. bits 5 and 4 can control input/output data of cts pin. bits 3 and 2 can control input/output data of sck pin. bits 1 and 0 can input data from rxd pin and output data to txd pi n, so they control break of serial transmitting/receiving. the cpu can always read and write to scsptr. scsptr is initialized to h'0050 by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000001010000 r r r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: - - - - - - - - rtsio rtsdt ctsio ctsdt sckio sckdt spb2iospb2dt bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 rtsio 0 r/w rts port input/output indicates input or output of the serial port rts pin. when the rts pin is actually used as a port outputting the rtsdt bit value, the mce bit in scfcr should be cleared to 0. 0: rtsdt bit value not output to rts pin 1: rtsdt bit value output to rts pin 6 rtsdt 1 r/w rts port data indicates the input/output da ta of the serial port rts pin. input/output is specified by the rtsio bit. for output, the rtsdt bit value is output to the rts pin. the rts pin status is read from the rtsdt bit regardless of the rtsio bit setting. however, rts input/output must be set in the pfc. 0: input/output data is low level 1: input/output dat a is high level
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 957 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 ctsio 0 r/w cts port input/output indicates input or output of the serial port cts pin. when the cts pin is actually used as a port outputting the ctsdt bit value, the mce bit in scfcr should be cleared to 0. 0: ctsdt bit value not output to cts pin 1: ctsdt bit value output to cts pin 4 ctsdt 1 r/w cts port data indicates the input/output da ta of the serial port cts pin. input/output is specified by the ctsio bit. for output, the ctsdt bit value is output to the cts pin. the cts pin status is read from the ctsdt bit regardless of the ctsio bit setting. however, cts input/output must be set in the pfc. 0: input/output data is low level 1: input/output dat a is high level 3 sckio 0 r/w sck port input/output indicates input or output of the serial port sck pin. when the sck pin is actually used as a port outputting the sckdt bit value, the cke[1:0] bits in scscr should be cleared to 0. 0: sckdt bit value not output to sck pin 1: sckdt bit value output to sck pin 2 sckdt 0 r/w sck port data indicates the input/output data of the serial port sck pin. input/output is specified by the sckio bit. for output, the sckdt bit value is output to the sck pin. the sck pin status is read from the sckdt bit regardless of the sckio bit setting. however, sck input/output must be set in the pfc. 0: input/output data is low level 1: input/output dat a is high level
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 958 of 1262 rej09b0437-0100 bit bit name initial value r/w description 1 spb2io 0 r/w serial port break input/output indicates input or output of the serial port txd pin. when the txd pin is actually used as a port outputting the spb2dt bit value, the te bit in scscr should be cleared to 0. 0: spb2dt bit value not output to txd pin 1: spb2dt bit value output to txd pin 0 spb2dt 0 r/w serial port break data indicates the input data of the rxd pin and the output data of the txd pin used as se rial ports. input/output is specified by the spb2io bit. when the txd pin is set to output, the spb2dt bit value is output to the txd pin. the rxd pin status is read from the spb2dt bit regardless of the spb2io bit setting. however, rxd input and txd output must be set in the pfc. 0: input/output data is low level 1: input/output dat a is high level
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 959 of 1262 rej09b0437-0100 22.3.12 line status register (sclsr) the cpu can always read or write to sclsr, but cannot write 1 to the or er flag. this flag can be cleared to 0 only if it has first been read (after being set to 1). sclsr is initialized to h'0000 by a power-on reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r r r r r r r r r r r r r/(w) * bit: initial value: r/w: note: only 0 can be written to clear the flag after 1 is read. * - - - - - - - - - - - - - - - orer bit bit name initial value r/w description 15 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 orer 0 r/(w) * overrun error indicates the occurrence of an overrun error. 0: receiving is in progress or has ended normally * 1 [clearing conditions] ? orer is cleared to 0 when the chip is a power-on reset ? orer is cleared to 0 when 0 is written after 1 is read from orer. 1: an overrun error has occurred * 2 [setting condition] ? orer is set to 1 when the next serial receiving is finished while the receive fifo is full of 16-byte receive data. notes: 1. clearing the re bit to 0 in scscr does not affect the orer bit, which retains its previous value. 2. the receive fifo data register (scfrdr) retains the data before an overrun error has occurred, and the next received data is discarded. when the orer bit is set to 1, the scif cannot continue the next serial reception.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 960 of 1262 rej09b0437-0100 22.4 operation 22.4.1 overview for serial communication, th e scif has an asynchronous mode in which characters are synchronized individually, and a clocked synchronous mode in which communication is synchronized with clock pulses. the scif has a 16-stage fifo buffer for both tr ansmission and receptions, reducing the overhead of the cpu, and enabling continuous high-speed communication. furthermore, rts and cts signals are provided as modem control signals. furthermore, rts and cts signals are provided as modem control signals. the transmission format is select ed in the serial mode register (scsmr), as shown in table 15.9. the scif clock source is selected by the combination of the ck e[1:0] bits in the serial control register (scscr), as shown in table 22.10. (1) asynchronous mode ? data length is selectable: 7 or 8 bits ? parity bit is selectable. so is the stop bit length (1 or 2 bits). the combination of the preceding selections constitutes the communication format and character length. ? in receiving, it is possible to detect framing er rors, parity errors, r eceive fifo data full, overrun errors, receive data ready, and breaks. ? the number of stored data bytes is indicated for both the transm it and receive fifo registers. ? an internal or external clock can be selected as the scif clock source. ? when an internal clock is selected, the scif operates using the clock of on-chip baud rate generator. ? when an external clock is selected, the external clock input must have a frequency 16 times the bit rate. (the on-chip baud rate generator is not used.)
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 961 of 1262 rej09b0437-0100 (2) clocked synchronous mode ? the transmission/reception format has a fixed 8-bit data length. ? in receiving, it is possible to detect overrun errors (orer). ? an internal or external clock can be selected as the scif clock source. ? when an internal clock is selected, the scif operates using the clock of the on-chip baud rate generator, and outputs this clock to external devices as the synchronous clock. ? when an external clock is selected, the scif operates on the input external synchronous clock not using the on-chip baud rate generator. table 22.9 scsmr settings and scif communication formats scsmr settings scif communication format bit 7 c/ a bit 6 chr bit 5 pe bit 3 stop mode data length pari ty bit stop bit length 0 0 0 0 8 bits not set 1 bit 1 2 bits 1 0 set 1 bit 1 2 bits 1 0 0 7 bits not set 1 bit 1 2 bits 1 0 set 1 bit 1 asynchronous 2 bits 1 x x x clocked synchronous 8 bits not set none [legend] x: don't care
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 962 of 1262 rej09b0437-0100 table 22.10 scsmr and scscr setting s and scif clock source selection scsmr scscr scif transmit/receive clock bit 7 c/ a bit 1, 0 cke[1:0] mode clock source sck pin function 00 scif does not use the sck pin 01 internal outputs a clock with a frequency 16 times the bit rate 10 external inputs a clock with frequency 16 times the bit rate 0 11 asynchronous setting prohibited 0x internal outputs the serial clock 10 external inputs the serial clock 1 11 clocked synchronous setting prohibited [legend] x: don't care
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 963 of 1262 rej09b0437-0100 22.4.2 operation in asynchronous mode in asynchronous mode, each transmitted or received ch aracter begins with a start bit and ends with a stop bit. serial comm unication is synchronized one character at a time. the transmitting and receiving sections of th e scif are independent, so full duplex communication is possible. the tr ansmitter and receiver are 16-byte fifo buffered, so data can be written and read while transmitting and receiving are in progress, enabling continuous transmitting and receiving. figure 22.2 shows the general format of asynchronous seri al communication. in asynchronous serial communication, the communication line is normally held in the mark (high) state. the scif monitors the line and starts serial communi cation when the line goes to the space (low) state, indicating a start b it. one serial character consists of a start bit (low), data (lsb first), parity bit (high or low), an d stop bit (high), in that order. when receiving in asynchronous mode , the scif synchronizes at the falling edge of the start bit. the scif samples each data bit on the eighth pulse of a clock with a frequency 16 times the bit rate. receive data is latched at the center of each bit. 0 1 d 0 d 1 d 3 d 4 d 5 d 6 d 2 0/1 11 1 d 7 (lsb) (msb) start bit idle state (mark state) stop bit transmit/receive data serial data parity bit 1 bit 1 or 2 bits 7 or 8 bits 1 bit or none one unit of transfer data (character or frame) figure 22.2 example of data form at in asynchronous communication (8-bit data with parity and two stop bits)
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 964 of 1262 rej09b0437-0100 (1) transmit/receive formats table 22.11 lists the eight communication formats th at can be selected in asynchronous mode. the format is selected by settings in the serial mode register (scsmr). table 22.11 serial communication formats (asynchronous mode) scsmr setting chr pe stop 0 0 0 start 8-bit data stop 0 1 1 1 10 0 10 1 1 1 23456 789101112 serial transmition/reception format and frame length start 8-bit data stop stop start 8- bit data p stop start 8-bit data p stop stop start 7-bit data stop start 7-bit data stop stop start 7-bit data p stop start 7-bit data p stop stop [legend] start: start bit stop: stop bit p: parity bit
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 965 of 1262 rej09b0437-0100 (2) clock an internal clock generated by the on-chip baud rate generator or an external clock input from the sck pin can be selected as the scif transmit/recei ve clock. the clock sour ce is selected by the c/ a bit in the serial mode register (scsmr) and bits cke[1:0] in the serial control register (scscr). for clock source selection, refer to table 15.10, scsmr and scscr settings and scif clock source selection. when an external clock is input at the sck pin, it must have a frequency equal to 16 times the desired bit rate. when the scif operates on an internal clock, it can output a clock signal on the sck pin. the frequency of this output clock is 16 times the desired bit rate. (3) transmitting and receiving data ? scif initialization (asynchronous mode) before transmitting or receiving, clear the te and re bits to 0 in the serial control register (scscr), then initialize the scif as follows. when changing the operation mode or the communication format, always clear the te and re bits to 0 before following the procedure given below. clearing te to 0 initializes the transmit shift register (sctsr). clearing te and re to 0, however, does not initialize the serial status register (scfsr), transmit fifo data register (scftdr), or receive fifo data register (scfrdr), which retain their previous contents. clear te to 0 afte r all transmit data has been transmitted and the tend flag in the scfsr is set. the te bit can be cleared to 0 during transmission, but the transmit data goes to the mark state after the bit is cleared to 0. set the tfrst bit in scfcr to 1 and reset scftdr before te is set again to start transmission. when an external clock is used, the clock should not be stopped during initialization or subsequent operation. scif operation becomes unreliable if the clock is stopped.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 966 of 1262 rej09b0437-0100 figure 22.3 shows a sample flowchart for initializing the scif. start of initialization clear te and re bits in scscr to 0 set tfrst and rfrst bits in scfcr to 1 set cke[1:0] in scscr (leaving tie, rie, te, and re bits cleared to 0) set data transfer format in scsmr set value in scbrr set rtrg[1:0], ttrg[1:0], and mce bits in scfcr, and clear tfrst and rfrst bits to 0 pfc setting for external pins used sck, txd, rxd set te and re bits in scscr to 1, and set tie, rie, and reie bits end of initialization set the clock selection in scscr. be sure to clear bits tie, rie, te, and re to 0. set the data transfer format in scsmr. write a value corresponding to the bit rate into scbrr. (not necessary if an external clock is used.) sets pfc for external pins used. set as rxd input at receiving and txd at transmission. however, no setting for sck pin is required when cke[1:0] is 00. in the case when internal synchronous clock output is set, the sck pin starts outputting the clock at this stage. set the te bit or re bit in scscr to 1. also set the rie, reie, and tie bits. setting the te and re bits enables the txd and rxd pins to be used. when transmitting, the scif will go to the mark state; when receiving, it will go to the idle state, waiting for a start bit. [1] [1] [2] [3] [4] [5] [2] [3] [4] [5] after reading er, dr, and brk flags in scfsr, and each flag in sclsr, write 0 to clear them figure 22.3 sample flowchart for scif initialization
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 967 of 1262 rej09b0437-0100 ? transmitting serial da ta (asynchronous mode) figure 22.4 shows a sample flow chart for serial transmission. use the following procedure for serial data transmission after enabling the scif for transmission. start of transmission read tdfe flag in scfsr tdfe = 1? write transmit data in scftdr, and read 1 from tdfe flag and tend flag in scfsr, then clear to 0 all data transmitted? read tend flag in scfsr tend = 1? break output? clear spb2dt to 0 and set spb2io to 1 clear te bit in scscr to 0 end of transmission no yes no yes no yes no yes [1] scif status check and transmit data write: read scfsr and check that the tdfe flag is set to 1, then write transmit data to scftdr, and read 1 from the tdfe and tend flags, then clear to 0. the quantity of transmit data that can be written is 16 - (transmit trigger set number). [2] serial transmission continuation procedure: to continue serial transmission, read 1 from the tdfe flag to confirm that writing is possible, then write data to scftdr, and then clear the tdfe flag to 0. [3] break output during serial transmission: to output a break in serial transmission, clear the spb2dt bit to 0 and set the spb2io bit to 1 in scsptr, then clear the te bit in scscr to 0. in [1] and [2], it is possible to ascertain the number of data bytes that can be written from the number of transmit data bytes in scftdr indicated by the upper 8 bits of scfdr. [1] [2] [3] figure 22.4 sample flowchart for transmitting serial data
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 968 of 1262 rej09b0437-0100 in serial transmission, the scif operates as described below. 1. when data is written into the transmit fifo data register (scftdr), the scif transfers the data from scftdr to the transmit shift register (sctsr) and starts tran smitting. confirm that the tdfe flag in the serial status register (sc fsr) is set to 1 before writing transmit data to scftdr. the number of data bytes that can be written is (16 ? transmit trigger setting). 2. when data is transferred from scftdr to sctsr and transmission is started, consecutive transmit operations are performed until there is no transmit data left in scftdr. when the number of transmit data bytes in scftdr falls below the transmit trigger number set in the fifo control register (scfcr), the tdfe flag is se t. if the tie bit in the serial control register (scsr) is set to 1 at this time, a transm it-fifo-data-empty interrupt (txi) request is generated. the serial transmit data is sent from the txd pin in the following order. a. start bit: one-bit 0 is output. b. transmit data: 8-bit or 7-bit data is output in lsb-first order. c. parity bit: one parity bit (even or odd parity) is output. (a format in which a parity bit is not output can also be selected.) d. stop bit(s): one or two 1 bits (stop bits) are output. e. mark state: 1 is output continuously until the start bit that starts the next transmission is sent. 3. the scif checks the scftdr transmit data at the timing for sending the stop bit. if data is present, the data is transferred from scftdr to sctsr, the stop bit is sent, and then serial transmission of the next frame is started.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 969 of 1262 rej09b0437-0100 figure 22.5 shows an example of the operation for transmission. tdfe 0 0/1 1 1 1 d 0 d 1 d 7 0 0/1 1 d 0 d 1 d 7 tend serial data start bit data parity bit stop bit start bit idle state (mark state) data parity bit stop bit txi interrupt request data written to scftdr and tdfe flag read as 1 then cleared to 0 by txi interrupt handler one frame txi interrupt request figure 22.5 example of transmit operation (8-bit data, parity, 1 stop bit) 4. when modem control is enabled, transmission can be stopped and rest arted in accordance with the cts input value. when cts is set to 1, if transmission is in progress, the line goes to the mark state after transmission of one frame. when cts is set to 0, the next transmit data is output starting from the start bit. figure 22.6 shows an example of the operation when modem control is used. cts 0 0/1 d 0 d 1 d 7 0 0/1 d 0 d 1 d 7 serial data txd drive high before stop bit start bit parity bit stop bit start bit figure 22.6 example of op eration using modem control ( cts )
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 970 of 1262 rej09b0437-0100 ? receiving serial data (asynchronous mode) figures 22.7 and 22.8 show sample flowcharts for serial reception. use the following procedure for serial data r eception after enab ling the scif for reception. start of reception read er, dr, brk flags in scfsr and orer flag in sclsr er, dr, brk or orer = 1? read rdf flag in scfsr rdf = 1? read receive data in scfrdr, and clear rdf flag in scfsr to 0 all data received? clear re bit in scscr to 0 end of reception yes no yes yes no no error handling [1] receive error handling and break detection: read the dr, er, and brk flags in scfsr, and the orer flag in sclsr, to identify any error, perform the appropriate error handling, then clear the dr, er, brk, and orer flags to 0. in the case of a framing error, a break can also be detected by reading the value of the rxd pin. [2] scif status check and receive data read: read scfsr and check that rdf flag = 1, then read the receive data in scfrdr, read 1 from the rdf flag, and then clear the rdf flag to 0. the transition of the rdf flag from 0 to 1 can also be identified by a receive fifo data full interrupt (rxi). [3] serial reception continuation procedure: to continue serial reception, read at least the receive trigger set number of receive data bytes from scfrdr, read 1 from the rdf flag, then clear the rdf flag to 0. the number of receive data bytes in scfrdr can be ascertained by reading from scrfdr. [1] [2] [3] figure 22.7 sample flowchar t for receiving serial data
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 971 of 1262 rej09b0437-0100 error handling receive error handling er = 1? brk = 1? break handling dr = 1? read receive data in scfrdr clear dr, er, brk flags in scfsr, and orer flag in sclsr to 0 end yes yes yes no overrun error handling orer = 1? yes no no no ? whether a framing error or parity error has occurred in the receive data that is to be read from the receive fifo data register (scfrdr) can be ascertained from the fer and per bits in the serial status register (scfsr). ? when a break signal is received, receive data is not transferred to scfrdr while the brk flag is set. however, note that the last data in scfrdr is h'00, and the break data in which a framing error occurred is stored. figure 22.8 sample flowchart fo r receiving serial data (cont)
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 972 of 1262 rej09b0437-0100 in serial reception, the scif operates as described below. 1. the scif monitors the transmission line, and if a 0 start bit is detected, performs internal synchronization and starts reception. 2. the received data is stored in scrsr in lsb-to-msb order. 3. the parity bit and stop bit are received. after receiving these bits, the scif carries out the following checks. a. stop bit check: the scif checks whether the st op bit is 1. if there are two stop bits, only the first is checked. b. the scif checks whether receive data can be transferred from the receive shift register (scrsr) to scfrdr. c. overrun check: the scif checks that the orer flag is 0, indicating that the overrun error has not occurred. d. break check: the scif checks that the brk fl ag is 0, indicating that the break state is not set. if all the above checks are passed, the receive data is stored in scfrdr. note: when a parity error or a framing error occurs, reception is not suspended. 4. if the rie bit in scscr is set to 1 when th e rdf or dr flag change s to 1, a receive-fifo- data-full interrupt (rxi) request is generated. if the rie bit or the reie bit in scscr is set to 1 when the er flag changes to 1, a receive-error interrupt (eri) request is generated. if the rie bit or the reie bit in scscr is set to 1 when the brk or orer flag changes to 1, a break reception interrupt (br i) request is generated. figure 22.9 shows an example of the operation for reception.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 973 of 1262 rej09b0437-0100 rdf 0 0/1 1 1 1 d 0 d 1 d 7 0 0/1 1 d 0 d 1 d 7 fer serial data start bit data parity bit stop bit start bit data parity bit stop bit rxi interrupt request one frame data read and rdf flag read as 1 then cleared to 0 by rxi interrupt handler eri interrupt request generated by receive error idle state (mark state) figure 22.9 example of scif receive operation (8-bit data, parity, 1 stop bit) 5. when modem control is enabled, the rts signal is output when scfrdr is empty. when rts is 0, reception is possible. when rts is 1, this indicates that scfrdr exceeds the number set for the rts output active trigger. figure 22.10 shows an example of the operation when modem control is used. rts 01 0/1 d 0 d 1 d 2 d 7 d 0 d 1 d 1 d 7 0 serial data rxd start bit parity bit start bit figure 22.10 example of op eration using modem control ( rts )
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 974 of 1262 rej09b0437-0100 22.4.3 operation in cl ocked synchronous mode in clocked synchronous mode, the scif transmits and receives data in sync hronization with clock pulses. this mode is suitable for high-speed serial communication. the scif transmitter and receiver are independe nt, so full-duplex communication is possible while sharing the same clock. th e transmitter and receiver are al so 16-byte fifo buffered, so continuous transmitting or receiving is possible by reading or writing data while transmitting or receiving is in progress. figure 22.11 shows the general format in clocked synchronous serial communication. bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 * * lsb msb don't care don't care one unit of transfer data (character or frame) serial data serial clock note: * high except in continuous transfer figure 22.11 data format in clocked synchronous communication
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 975 of 1262 rej09b0437-0100 in clocked synchronous serial communication, eac h data bit is output on the communication line from one falling edge of the serial clock to the next . data is guaranteed valid at the rising edge of the serial clock. in each character, the serial data bits are tran smitted in order from the lsb (first) to the msb (last). after output of the msb, the communication line remains in the state of the msb. in clocked synchronous mode, the scif receives data by synchronizing with the rising edge of the serial clock. (1) transmit/receive formats the data length is fixed at eight bits. no parity bit can be added. (2) clock an internal clock generated by the on-chip baud rate generator by the setting of the c/a bit in scsmr and cke[1:0] in scscr, or an external cl ock input from the sck pin can be selected as the scif transmit/receive clock. when the scif operates on an internal clock, it outputs the clock signal at the sck pin. eight clock pulses are output per transmitted or received character. when the scif is not transmitting or receiving, the clock signal remains in the high st ate. when only receiving, the clock signal outputs while the re bit of scscr is 1 an d the number of data in receive fifo is more than the receive fifo data trigger number. in this case, a synchronizing clock consisting of 136 pulses, 8 (16 + 1) = 136, is output. when receiving n characters, the clock source should be changed to an external clock. when the internal clock is used , set re = 1 and te = 1 to enable a procedure for sending dummy data consisting of n ch aracters and receiving n characters. (3) transmitting and receiving data ? scif initialization (clocked synchronous mode) before transmitting, receiving, or changing the mode or communication form at, the software must clear the te and re bits to 0 in the serial co ntrol register (scscr), then initialize the scif. clearing te to 0 initializes the transmit shift regi ster (sctsr). clearing re to 0, however, does not initialize the rdf, per, fer, and orer flag s and receive data regi ster (scrdr), which retain their previous contents.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 976 of 1262 rej09b0437-0100 figure 22.12 shows a sample flowchart for initializing the scif. start of initialization clear te and re bits in scscr to 0 set tfrst and rfrst bits in scfcr to 1 to clear the fifo buffer after reading er, dr, and brk flags in scfsr, write 0 to clear them set cke[1:0] in scscr (leaving tie, rie, te, and re bits cleared to 0) set data transfer format in scsmr pfc setting for external pins used sck, txd, rxd set value in scbrr set rtrg[1:0] and ttrg[1:0] bits in scfcr, and clear tfrst and rfrst bits to 0 set te and re bits in scscr to 1, and set tie, rie, and reie bits end of initialization leave the te and re bits cleared to 0 until the initialization almost ends. be sure to clear the tie, rie, te, and re bits to 0. set the data transfer format in scsmr. set cke[1:0]. write a value corresponding to the bit rate into scbrr. this is not necessary if an external clock is used. sets pfc for external pins used. set as rxd input at receiving and txd at transmission. set the te or re bit in scscr to 1. also set the tie, rie, and reie bits to enable the txd, rxd, and sck pins to be used. when transmitting, the txd pin will go to the mark state. when receiving in clocked synchronous mode with the synchronization clock output (clock master) selected, a clock starts to be output from the sck pin at this point. [1] [1] [2] [3] [4] [5] [6] [2] [3] [4] [5] [6] figure 22.12 sample flowchart for scif initialization
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 977 of 1262 rej09b0437-0100 ? transmitting serial data (clocked synchronous mode) figure 22.13 shows a sample flowchart for transmitting serial data. use the following procedure for serial data transmission after enabling the scif for transmission. start of transmission read tdfe flag in scfsr tdfe = 1? write transmit data to scftdr and clear tdfe flag in scfsr to 0 all data transmitted? read tend flag in scfsr tend = 1? clear te bit in scscr to 0 end of transmission no yes no yes no yes [1] scif status check and transmit data write: read scfsr and check that the tdfe flag is set to 1, then write transmit data to scftdr, and clear the tdfe flag to 0. [2] serial transmission continuation procedeure: to continue serial transmission, read 1 from the tdfe flag to confirm that writing is possible, them write data to scftdr, and then clear the tdfe flag to 0. [1] [2] figure 22.13 sample flowchart for transmitting serial data
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 978 of 1262 rej09b0437-0100 in serial transmission, the scif operates as described below. 1. when data is written into the transmit fifo data register (scftdr), the scif transfers the data from scftdr to the transmit shift register (sctsr) and starts tran smitting. confirm that the tdfe flag in the serial status register (sc fsr) is set to 1 before writing transmit data to scftdr. the number of data bytes that can be written is (16 ? transmit trigger setting). 2. when data is transferred from scftdr to sctsr and transmission is started, consecutive transmit operations are performed until there is no transmit data left in scftdr. when the number of transmit data bytes in scftdr falls below the transmit trigger number set in the fifo control register (scfcr), the tdfe flag is se t. if the tie bit in the serial control register (scsr) is set to 1 at this time, a transm it-fifo-data-empty interrupt (txi) request is generated. if clock output mode is selected, the scif outputs eight synchronous clock pulses. if an external clock source is selected, the scif ou tputs data in synchronization with the input clock. data is output from the txd pin in order from the lsb (bit 0) to the msb (bit 7). 3. the scif checks the scftdr transmit data at the timing for sending the msb (bit 7). if data is present, the data is transfer red from scftdr to sctsr, and then serial transmission of the next frame is started. if there is no data, th e txd pin holds the state after the tend flag in scfsr is set to 1 and the msb (bit 7) is sent. 4. after the end of serial transmission, the sck pin is held in the high state. figure 22.14 shows an example of scif transmit operation. serial clock serial data tdfe tend data written to scftdr and tdfe flag cleared to 0 by txi interrupt handler one frame bit 0 lsb txi interrupt request msb bit 1 bit 6 bit 7 bit 7 bit 0 bit 1 txi interrupt request figure 22.14 example of scif transmit operation
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 979 of 1262 rej09b0437-0100 ? receiving serial data (c locked synchronous mode) figures 22.15 and 22.16 show samp le flowcharts for receiving seri al data. when switching from asynchronous mode to clocked synchronous mode without scif initialization, make sure that orer, per, and fer are cleared to 0. start of reception read orer flag in sclsr orer = 1? read rdf flag in scfsr rdf = 1? read receive data in scfrdr, and clear rdf flag in scfsr to 0 all data received? clear re bit in scscr to 0 end of reception yes no yes yes no no error handling [1] receive error handling: read the orer flag in sclsr to identify any error, perform the appropriate error handling, then clear the orer flag to 0. reception cannot be resumed while the orer flag is set to 1. [2] scif status check and receive data read: read scfsr and check that rdf = 1, then read the receive data in scfrdr, and clear the rdf flag to 0. the transition of the rdf flag from 0 to 1 can also be identified by a receive fifo data full interrupt (rxi). [3] serial reception continuation procedure: to continue serial reception, read at least the receive trigger set number of receive data bytes from scfrdr, read 1 from the rdf flag, then clear the rdf flag to 0. the number of receive data bytes in scfrdr can be ascertained by reading scfrdr. however, the rdf bit is cleared to 0 automatically when an rxi interrupt activates the dmac to read the data in scfrdr. [1] [2] [3] figure 22.15 sample flowchart for receiving serial data (1)
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 980 of 1262 rej09b0437-0100 error handling clear orer flag in sclsr to 0 end overrun error handling orer = 1? yes no figure 22.16 sample flowchart for receiving serial data (2)
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 981 of 1262 rej09b0437-0100 in serial reception, the scif operates as described below. 1. the scif synchronizes with serial clock input or output and starts the reception. 2. receive data is shifted into scrsr in order from the lsb to the msb. after receiving the data, the scif checks the receive data can be load ed from scrsr into scfrdr or not. if this check is passed, the rdf flag is set to 1 and th e scif stores the received data in scfrdr. if the check is not passed (overrun error is de tected), further recep tion is prevented. 3. after setting rdf to 1, if the receive fifo data full interrupt enable bit (rie) is set to 1 in scscr, the scif requests a recei ve-data-full interrupt (rxi). if the orer bit is set to 1 and the receive-data-full interr upt enable bit (rie) or the receive error interrupt enable bit (reie) in scscr is also set to 1, the sc if requests a break interrupt (bri). figure 22.17 shows an example of scif receive operation. bit 7 bit 0 lsb msb bit 7 bit 0 bit 1 bit 6 bit 7 rdf orer serial clock serial data data read from scfrdr and rdf flag cleared to 0 by rxi interrupt handler one frame rxi interrupt request bri interrupt request by overrun error rxi interrupt request figure 22.17 example of scif receive operation
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 982 of 1262 rej09b0437-0100 ? transmitting and receiving serial data si multaneously (clocked synchronous mode) figure 22.18 shows a samp le flowchart for transmit ting and receiving serial data simultaneously. use the following procedure for the simultaneous transmission/r eception of serial data, after enabling the scif for tr ansmission/reception. start of transmission and reception initialization read tdfe flag in scfsr tdfe = 1? write transmit data to scftdr, and clear tdfe flag in scfsr to 0 read orer flag in sclsr orer = 1? read rdf flag in scfsr rdf = 1? clear te and re bits in scscr to 0 end of transmission and reception read receive data in scfrdr, and clear rdf flag in scfsr to 0 all data received? no no yes no no yes yes [1] scif status check and transmit data write: read scfsr and check that the tdfe flag is set to 1, then write transmit data to scftdr, and clear the tdfe flag to 0. the transition of the tdfe flag from 0 to 1 can also be identified by a transmit fifo data empty interrupt (txi). [2] receive error handling: read the orer flag in sclsr to identify any error, perform the appropriate error handling, then clear the orer flag to 0. reception cannot be resumed while the orer flag is set to 1. [3] scif status check and receive data read: read scfsr and check that rdf flag = 1, then read the receive data in scfrdr, and clear the rdf flag to 0. the transition of the rdf flag from 0 to 1 can also be identified by a receive fifo data full interrupt (rxi). [4] serial transmission and reception continuation procedure: to continue serial transmission and reception, read 1 from the rdf flag and the receive data in scfrdr, and clear the rdf flag to 0 before receiving the msb in the current frame. similarly, read 1 from the tdfe flag to confirm that writing is possible before transmitting the msb in the current frame. then write data to scftdr and clear the tdfe flag to 0. [1] yes error handling [4] when switching from a transmit operation or receive operation to simultaneous transmission and reception operations, clear the te and re bits to 0, and then set them simultaneously to 1. note: [3] [2] figure 22.18 sample flowchart for transmitting/receiving serial data
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 983 of 1262 rej09b0437-0100 22.5 scif interrupts the scif has four interrupt sources: transmit-fifo-data-empty (txi), receive-error (eri), receive fifo data full (rxi), and break (bri). table 22.12 shows the interrupt sources and their order of priority. the interrupt sources are enabled or disabled by means of the tie, rie, and reie bits in scscr. a separate interrupt request is sent to the interrupt contro ller for each of these interrupt sources. when a txi request is enabled by the tie bit and the tdfe flag in the se rial status register (scfsr) is set to 1, a txi interrupt request is generated. the dmac can be activated and data transfer performed by this txi interrupt request. at this time, an interrupt request is not sent to the cpu. when an rxi request is enabled by the rie bit and the rdf flag or the dr flag in scfsr is set to 1, an rxi interrupt request is generated. the dmac can be activated and data transfer performed by this rxi interrupt request. at this tim e, an interrupt request is not sent to the cpu. the rxi interrupt request caused by the dr flag is generated only in asynchronous mode. when the rie bit is set to 0 and the reie bit is set to 1, the scif requests only an eri interrupt without requesting an rxi interrupt. the txi indicates that transmit data can be written, and the rxi indicates that there is receive data in scfrdr. table 22.12 scif interrupt sources interrupt source description dmac activation priority on reset release bri interrupt initiated by break (brk) or overrun error (orer) not possible high eri interrupt initiated by receive error (er) not possible rxi interrupt initiated by re ceive fifo data full (rdf) or data ready (dr) possible txi interrupt initiated by transmit fifo data empty (tdfe) possible low
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 984 of 1262 rej09b0437-0100 22.6 usage notes note the following when using the scif. 22.6.1 scftdr writing and tdfe flag the tdfe flag in the serial stat us register (scfsr) is set when the number of transmit data bytes written in the transmit fifo data register (scftd r) has fallen below the transmit trigger number set by bits ttrg[1:0] in the fifo control register (scfcr). after the tdfe flag is set, transmit data up to the number of empty bytes in scftdr can be written, allowing efficient continuous transmission. however, if the number of data bytes written in scftdr is equal to or less than the transmit trigger number, the tdfe flag will be set to 1 agai n after being read as 1 and cleared to 0. tdfe flag clearing should therefore be carried out when scftdr contains more than the transmit trigger number of transmit data bytes. the number of tran smit data bytes in scftdr can be found from the upper 8 bits of the fifo data count register (scfdr). 22.6.2 scfrdr reading and rdf flag the rdf flag in the serial status register (scfsr) is set when the number of receive data bytes in the receive fifo data register (scfrdr) has beco me equal to or greater than the receive trigger number set by bits rtrg[1:0] in the fifo cont rol register (scfcr). after rdf flag is set, receive data equivalent to th e trigger number can be read from scfrdr, allowing efficient continuous reception. however, if the number of data bytes in scfrdr exceeds the trigger numb er, the rdf flag will be set to 1 again if it is cleared to 0. the rdf flag should therefore be clea red to 0 after being read as 1 after reading the number of the received data in the receiv e fifo data register (scfrdr) which is less than the trigger number. the number of receive data bytes in scfrdr can be found from the lower 8 bits of the fifo data count register (scfdr).
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 985 of 1262 rej09b0437-0100 22.6.3 break detection and processing break signals can be detected by reading the rxd pin directly when a framing error (fer) is detected. in the break stat e the input from the rxd pin consists of all 0s, so the fer flag is set and the parity error flag (per) may also be set. note that, although transf er of receive data to scfrdr is ha lted in the break state, the scif receiver continues to operate. 22.6.4 sending a break signal the i/o condition and level of the txd pin are determined by the spb2io and spb2dt bits in the serial port register (scsptr). this feature can be used to send a break signal. until te bit is set to 1 (enabling transmission) after initializing, the txd pin does not work. during the period, mark status is performed by the spb2dt bit. therefore, the spb2io and spb2dt bits should be set to 1 (high level output). to send a break signal during serial transmissi on, clear the spb2dt bit to 0 (designating low level), then clear the te bit to 0 (halting transmission). when the te bit is cleared to 0, the transmitter is initialized regardless of the current tr ansmission state, and 0 is output from the txd pin. 22.6.5 receive data sampling timing an d receive margin (asynchronous mode) the scif operates on a base clock with a frequency of 16 times the transfer rate. in reception, the scif synchronizes internally with the fall of the start bit, which it samples on the base clock. receive data is latched at the ri sing edge of the eighth base cl ock pulse. the timing is shown in figure 22.19.
section 22 serial communication interface with fifo (scif) rev. 1.00 nov. 14, 2007 page 986 of 1262 rej09b0437-0100 d0 d1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 clocks 8 clocks base clock receive data (rxd) start bit ?7.5 clocks +7.5 clocks synchronization sampling timing data sampling timing figure 22.19 receive data sampling timing in asynchronous mode the receive margin in asynchron ous mode can therefore be expres sed as shown in equation 1. equation 1: m = { (0.5 ? ) ? (l ? 0.5) f ? (1 + f) } 100 % 1 2n d ? 0.5 n where: m: receive margin (%) n: ratio of clock frequency to bit rate (n = 16) d: clock duty (d = 0 to 1.0) l: frame length (l = 9 to 12) f: absolute deviation of clock frequency from equation 1, if f = 0 and d = 0.5, the receive margin is 46.875%, as given by equation 2. equation 2: when d = 0.5 and f = 0: m = (0.5 ? 1/(2 16)) 100% = 46.875% this is a theoretical value. a reasonable margin to allow in system designs is 20% to 30%.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 987 of 1262 rej09b0437-0100 section 23 pin function controller (pfc) the pin function controller (pfc) consists of registers that select the functions of the multiplexed pins and their i/o directions. tables 23.1 to 23.7 list the multiplexed pins of this lsi. table 23.8 lists pin functions for each operating mode. table 23.1 list of mult iplexed pins (port a) port function 1 (related modules) function 2 (related modules) function 3 (related modules) function 4 (related modules) function 5 (related modules) a pa25 i/o (port) a25 output (bsc) ? ? hifmd input (hif) pa24 i/o (port) a24 output (bsc) ? ? ? pa23 i/o (port) a23 output (bsc) ? ? ? pa22 i/o (port) a22 output (bsc) ? ? ? pa21 i/o (port) a21 output (bsc) ? ? ? pa20 i/o (port) a20 output (bsc) ? ? ? pa19 i/o (port) a19 output (bsc) ? ? ? pa18 i/o (port) a18 output (bsc) ? ? ? pa17 i/o (port) a17 output (bsc) ? ? ? table 23.2 list of mult iplexed pins (port b) port function 1 (related modules) function 2 (related modules) function 3 (related modules) function 4 (related modules) b pb07 i/o (port) bs output (bsc) ? ? pb06 input (port) cs4 output (bsc) ? ? pb05 i/o (port) cs5 output (bsc) ce1a output (bsc) irq3 input (intc) tend1 output (dmac) pb04 i/o (port) ce2a output (bsc) irq2 input (intc) dack1 output (dmac) pb03 input (port) cs6 output (bsc) ce1b output (bsc) irq1 input (intc) dreq1 input (dmac) pb02 input (port) ce2b output (bsc) irq0 input (intc) ? pb01 input (port) iois16 input (bsc) scl i/o (iic) ? pb00 input (port) wait input (bsc) sda i/o (iic) ?
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 988 of 1262 rej09b0437-0100 table 23.3 list of mult iplexed pins (port c) port function 1 (related modules) function 2 (related modules) function 3 (related modules) function 4 (related modules) c pc20 i/o (port) wol output (etherc) ? ? pc19 i/o (port) exout output (etherc) ? ? pc18 i/o (port) lnksta input (etherc) ? ? pc17 i/o (port) mdc output (etherc) ? ? pc16 i/o (port) mdio i/o (etherc) ? ? pc15 i/o (port) crs input (etherc) ? ? pc14 i/o (port) col input (etherc) ? ? pc13 i/o (port) tx_clk input (etherc) ? ? pc12 i/o (port) tx_en output (etherc) ? ? pc11 i/o (port) tx_er output (etherc) ? ? pc10 i/o (port) rx_clk input (etherc) ? ? pc09 i/o (port) rx_er input (etherc) ? ? pc08 i/o (port) rx_dv input (etherc) ? ? pc07 i/o (port) mii_txd3 output (etherc) ? ? pc06 i/o (port) mii_txd2 output (etherc) ? ? pc05 i/o (port) mii_txd1 output (etherc) ? ? pc04 i/o (port) mii_txd0 output (etherc) ? ? pc03 i/o (port) mii_rxd3 input (etherc) ? ? pc02 i/o (port) mii_rxd2 input (etherc) ? ? pc01 i/o (port) mii_rxd1 input (etherc) ? ? pc00 input (port) mii_rxd0 input (etherc) ? ?
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 989 of 1262 rej09b0437-0100 table 23.4 list of mult iplexed pins (port d) port function 1 (related modules) function 2 (related modules) function 3 (related modules) function 4 (related modules) d pd07 i/o (port) irq7 input (intc) sdclk output (sdhi) ? pd06 i/o (port) irq6 input (intc) sdcmd i/o (sdhi) ? pd05 input (port) irq5 input (intc) sdcd input (sdhi) ? pd04 input (port) irq4 input (intc) sdwp input (sdhi) ? pd03 i/o (port) irq3 input (intc) sddat3 i/o (sdhi) ? pd02 i/o (port) irq2 input (intc) sddat2 i/o (sdhi) ? pd01 i/o (port) irq1 input (intc) sddat1 i/o (sdhi) ? pd00 i/o (port) irq0 input (intc) sddat0 i/o (sdhi) ? table 23.5 list of mult iplexed pins (port e) port function 1 (related modules) function 2 (related modules) function 3 (related modules) function 4 (related modules) e ? st1_clkin input (stif) ssisck1 i/o (ssi) ? ? st1_vco_clkin input (stif) audio_clk input (ssi) ? pe11 i/o (port) st1_pwm output (stif) rts2 i/o (scif) ? pe10 i/o (port) st1_syc i/o (stif) cts2 i/o (scif) ? pe09 i/o (port) st1_vld i/o (stif) sck2 i/o (scif) ? pe08 i/o (port) st1_req i/o (stif) txd2 output (scif) ? pe07 i/o (port) st1_d7 i/o (stif) ssiws1 i/o (ssi) ? pe06 i/o (port) st1_d6 i/o (stif) ssidata1 i/o (ssi) ? pe05 i/o (port) st1_d5 i/o (stif) rts1 i/o (scif) ? pe04 i/o (port) st1_d4 i/o (stif) cts1 i/o (scif) ? pe03 i/o (port) st1_d3 i/o (stif) sck1 i/o (scif) ? pe02 i/o (port) st1_d2 i/o (stif) rxd1 input (scif) ? pe01 i/o (port) st1_d1 i/o (stif) txd1 output (scif) ? pe00 i/o (port) st1_d0 i/o (stif) rxd2 input (scif) ?
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 990 of 1262 rej09b0437-0100 table 23.6 list of mult iplexed pins (port f) port function 1 (related modules) function 2 (related modules) function 3 (related modules) function 4 (related modules) f ? st_clkout output (stif) ? ? ? st0_clkin input (stif) ssisck0 i/o (ssi) ? ? st0_vco_clkin input (stif) ? ? pf11 i/o (port) st0_pwm output (stif) tend0 output (dmac) ? pf10 i/o (port) st0_syc i/o (stif) dack0 output (dmac) ? pf09 i/o (port) st0_vld i/o (stif) dreq0 input (dmac) ? pf08 i/o (port) st0_req i/o (stif) ? ? pf07 i/o (port) st0_d7 i/o (stif) ssiws0 i/o (ssi) ? pf06 i/o (port) st0_d6 i/o (stif) ssidata0 i/o (ssi) ? pf05 i/o (port) st0_d5 i/o (stif) rts0 i/o (scif) ? pf04 i/o (port) st0_d4 i/o (stif) cts0 i/o (scif) ? pf03 i/o (port) st0_d3 i/o (stif) sck0 i/o (scif) ? pf02 i/o (port) st0_d2 i/o (stif) rxd0 input (scif) ? pf01 i/o (port) st0_d1 i/o (stif) txd0 output (scif) ? pf00 i/o (port) st0_d0 i/o (stif) ? ?
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 991 of 1262 rej09b0437-0100 table 23.7 list of mult iplexed pins (port g) port function 1 (related modules) function 2 (related modules) function 3 (related modules) function 4 (related modules) g pg23 i/o (port) hifcs input (hif) ? ? pg22 i/o (port) hifrs input (hif) ? ? pg21 i/o (port) hifwr input (hif) ? ? pg20 i/o (port) hifrd input (hif) ? ? pg19 i/o (port) hifint output (hif) ? ? pg18 i/o (port) hifdreq output (hif) ? ? pg17 i/o (port) hifrdy output (hif) ? ? pg16 i/o (port) hifebl input (hif) ? ? pg15 i/o (port) hifd15 i/o (hif) ? ? pg14 i/o (port) hifd14 i/o (hif) ? ? pg13 i/o (port) hifd13 i/o (hif) ? ? pg12 i/o (port) hifd12 i/o (hif) ? ? pg11 i/o (port) hifd11 i/o (hif) ? ? pg10 i/o (port) hifd10 i/o (hif) ? ? pg09 i/o (port) hifd09 i/o (hif) ? ? pg08 i/o (port) hifd08 i/o (hif) ? ? pg07 i/o (port) hifd07 i/o (hif) ? ? pg06 i/o (port) hifd06 i/o (hif) ? ? pg05 i/o (port) hifd05 i/o (hif) ? ? pg04 i/o (port) hifd04 i/o (hif) ? ? pg03 i/o (port) hifd03 i/o (hif) ? ? pg02 i/o (port) hifd02 i/o (hif) ? ? pg01 i/o (port) hifd01 i/o (hif) ? ? pg00 i/o (port) hifd00 i/o (hif) ? ?
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 992 of 1262 rej09b0437-0100 table 23.8 list of pins fo r each operating mode (1) non-hif boot mode hif boot mode pin no. initial function settable function initial function settable function a2 a00 ? a00 ? b18 a01 ? a01 ? b17 a02 ? a02 ? c17 a03 ? a03 ? a16 a04 ? a04 ? b16 a05 ? a05 ? c16 a06 ? a06 ? a15 a07 ? a07 ? b15 a08 ? a08 ? c15 a09 ? a09 ? a14 a10 ? a10 ? b14 a11 ? a11 ? c14 a12 ? a12 ? a13 a13 ? a13 ? b13 a14 ? a14 ? c13 a15 ? a15 ? a12 a16 ? a16 ? a1 pa17 pa17/a17 pa17 pa17/a17 b1 pa18 pa18/a18 pa18 pa18/a18 c3 pa19 pa19/a19 pa19 pa19/a19 b2 pa20 pa20/a20 pa20 pa20/a20 c2 pa21 pa21/a21 pa21 pa21/a21 d3 pa22 pa22/a22 pa22 pa22/a22 e3 pa23 pa23/a23 pa23 pa23/a23 d2 pa24 pa24/a24 pa24 pa24/a24 c1 hifmd/pa25 * pa25/a25 hifmd/pa25 * pa25/a25 b12 d00 ? d00 ? c12 d01 ? d01 ? a11 d02 ? d02 ? b11 d03 ? d03 ?
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 993 of 1262 rej09b0437-0100 non-hif boot mode hif boot mode pin no. initial function settable function initial function settable function c11 d04 ? d04 ? a10 d05 ? d05 ? b10 d06 ? d06 ? c10 d07 ? d07 ? b7 d08 ? d08 ?
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 994 of 1262 rej09b0437-0100 table 23.8 list of pins fo r each operating mode (2) non-hif boot mode hif boot mode pin no. initial function settable function initial function settable function a7 d09 ? d09 ? b8 d10 ? d10 ? c8 d11 ? d11 ? a8 d12 ? d12 ? c9 d13 ? d13 ? b9 d14 ? d14 ? a9 d15 ? d15 ? k18 d16 ? d16 ? k17 d17 ? d17 ? j19 d18 ? d18 ? j18 d19 ? d19 ? h19 d20 ? d20 ? h18 d21 ? d21 ? g19 d22 ? d22 ? g18 d23 ? d23 ? e17 d24 ? d24 ? d19 d25 ? d25 ? e18 d26 ? d26 ? f17 d27 ? d27 ? e19 d28 ? d28 ? f18 d29 ? d29 ? f19 d30 ? d30 ? g17 d31 ? d31 ? a4 pb00 pb00/wait/sda pb00 pb00/wait/sda c5 pb01 pb01/iois16/scl pb01 pb01/iois16/scl b19 cke ? cke ? a19 cas ? cas ? a18 ras ? ras ? c7 (we0/dqmll) ? (we0/dqmll) ? a6 (we1/dqmlu/we) ? (we1/dqmlu/we) ?
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 995 of 1262 rej09b0437-0100 non-hif boot mode hif boot mode pin no. initial function settable function initial function settable function d18 (we2/dqmul/iciord) ? (we2/dqmul/iciord) ? d17 (we3/dqmuu/iciowr) ? (we3/dqmuu/iciowr) ? b5 rd ? rd ? c18 rdwr ? rdwr ? b4 pb02 pb02/ce2b/irq0 pb02 pb02/ce2b/irq0
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 996 of 1262 rej09b0437-0100 table 23.8 list of pins fo r each operating mode (3) non-hif boot mode hif boot mode pin no. initial function settable function initial function settable function c4 pb03 pb03/cs6/ce1b/irq1/ dreq1 pb03 pb03/cs6/ce1b/irq1/ dreq1 a3 pb04 pb04/ce2a/irq2/dack 1 pb04 pb04/ce2a/irq2/dack 1 b3 pb05 pb05/cs5/ce1a/irq3/ tend1 pb05 pb05/cs5/ce1a/irq3/ tend1 a5 pb06 pb06/cs4 pb06 pb06/cs4 a17 cs3 ? cs3 ? c6 cs0 ? cs0 ? b6 pb07 pb07/bs pb07 pb07/bs l3 pc00 pc00/mii_rxd0 pc00 pc00/mii_rxd0 l2 pc01 pc01/mii_rxd1 pc01 pc01/mii_rxd1 l1 pc02 pc02/mii_rxd2 pc02 pc02/mii_rxd2 k2 pc03 pc03/mii_rxd3 pc03 pc03/mii_rxd3 j3 pc04 pc04/mii_txd0 pc04 pc04/mii_txd0 h2 pc05 pc05/mii_txd1 pc05 pc05/mii_txd1 g1 pc06 pc06/mii_txd2 pc06 pc06/mii_txd2 g2 pc07 pc07/mii_txd3 pc07 pc07/mii_txd3 k1 pc08 pc08/rx_dv pc08 pc08/rx_dv k3 pc09 pc09/rx_er pc09 pc09/rx_er j1 pc10 pc10/rx_clk pc10 pc10/rx_clk h3 pc11 pc11/tx_er pc11 pc11/tx_er f1 pc12 pc12/tx_en pc12 pc12/tx_en f2 pc13 pc13/tx_clk pc13 pc13/tx_clk j2 pc14 pc14/col pc14 pc14/col h1 pc15 pc15/crs pc15 pc15/crs g3 pc16 pc16/mdio pc16 pc16/mdio e1 pc17 pc17/mdc pc17 pc17/mdc d1 pc18 pc18/lnksta pc18 pc18/lnksta e2 pc19 pc19/exout pc19 pc19/exout f3 pc20 pc20/wol pc20 pc20/wol
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 997 of 1262 rej09b0437-0100 non-hif boot mode hif boot mode pin no. initial function settable function initial function settable function r1 pd00 pd00/irq0/sdata0 pd00 pd00/irq0/sdata0 p3 pd01 pd01/irq1/sdata1 pd01 pd01/irq1/sdata1 p2 pd02 pd02/irq2/sdata2 pd02 pd02/irq2/sdata2 p1 pd03 pd03/irq3/sdata3 pd03 pd03/irq3/sdata3
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 998 of 1262 rej09b0437-0100 table 23.8 list of pins fo r each operating mode (4) non-hif boot mode hif boot mode pin no. initial function settable function initial function settable function n3 pd04 pd04/irq4/sdwp pd04 pd04/irq4/sdwp n2 pd05 pd05/irq5/sdcd pd05 pd05/irq5/sdcd n1 pd06 pd06/irq6/sdcmd pd06 pd06/irq6/sdcmd m3 pd07 pd07/irq7/sdclk pd07 pd07/irq7/sdclk w14 pe00 pe00/st1_d0/rxd2 pe00 pe00/st1_d0/rxd2 u12 pe01 pe01/st1_d1/txd1 pe01 pe01/st1_d1/txd1 w13 pe02 pe02/st1_d2/rxd1 pe02 pe02/st1_d2/rxd1 v13 pe03 pe03/st1_d3/sck1 pe03 pe03/st1_d3/sck1 v10 pe04 pe04/st1_d4/cts1 pe04 pe04/st1_d4/cts1 w12 pe05 pe05/st1_d5/rts1 pe05 pe05/st1_d5/rts1 u11 pe06 pe06/st1_d6/ssidata1 pe06 pe06/st1_d6/ssidata1 v12 pe07 pe07/st1_d7/ssiws1 pe07 pe07/st1_d7/ssiws1 w15 pe08 pe08/st1_req/txd2 pe08 pe08/st1_req/txd2 u13 pe09 pe09/st1_vld/sck2 pe09 pe09/st1_vld/sck2 v14 pe10 pe10/st1_syc/cts2 pe10 pe10/st1_syc/cts2 v15 pe11 pe11/st1_pwm/rts2 pe11 pe11/st1_pwm/rts2 u14 st1_vco_clkin st1_vco_clkin/ audio_clk st1_vco_clkin st1_vco_clkin audio_clk v16 st1_clkin st1_clkin/ssisck1 st1_clkin st1_clkin/ssisck1 n19 pf00 pf00/st0_d0 pf00 pf00/st0_d0 m19 pf01 pf01/st0_d1/txd0 pf01 pf01/st0_d1/txd0 m18 pf02 pf02/st0_d2/rxd0 pf02 pf02/st0_d2/rxd0 m17 pf03 pf03/st0_d3/sck0 pf03 pf03/st0_d3/sck0 l19 pf04 pf04/st0_d4/cts0 pf04 pf04/st0_d4/cts0 l18 pf05 pf05/st0_d5/rts0 pf05 pf05/st0_d5/rts0 l17 pf06 pf06/st0_d6/ssidata0 pf06 pf06/st0_d6/ssidata0 k19 pf07 pf07/st0_d7/ssiws0 pf07 pf07/st0_d7/ssiws0 p19 pf08 pf08/st0_req pf08 pf08/st0_req n18 pf09 pf09/st0_vld/dreq0 pf09 pf09/st0_vld/dreq0 n17 pf10 pf10/st0_syc/dack0 pf10 pf10/st0_syc/dack0
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 999 of 1262 rej09b0437-0100 non-hif boot mode hif boot mode pin no. initial function settable function initial function settable function p17 pf11 pf11/st0_pwm/tend0 pf11 pf11/st0_pwm/tend0 r19 st0_vco_clkin ? st0_ vco_clkin ? p18 st0_clkin st0_clkin/ssisck0 st0_clkin st0_clkin/ssisck0 w16 st_clkout ? st_clkout ?
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1000 of 1262 rej09b0437-0100 table 23.8 list of pins fo r each operating mode (5) non-hif boot mode hif boot mode pin no. initial function settable function initial function settable function w4 pg00 pg00/hifd00 hifd00 pg00/hifd00 v4 pg01 pg01/hifd01 hifd01 pg01/hifd01 w3 pg02 pg02/hifd02 hifd02 pg02/hifd02 w2 pg03 pg03/hifd03 hifd03 pg03/hifd03 v3 pg04 pg04/hifd04 hifd04 pg04/hifd04 u3 pg05 pg05/hifd05 hifd05 pg05/hifd05 v2 pg06 pg06/hifd06 hifd06 pg06/hifd06 w1 pg07 pg07/hifd07 hifd07 pg07/hifd07 v1 pg08 pg08/hifd08 hifd08 pg08/hifd08 u2 pg09 pg09/hifd09 hifd09 pg09/hifd09 u1 pg10 pg10/hifd10 hifd10 pg10/hifd10 t3 pg11 pg11/hifd11 hifd11 pg11/hifd11 t1 pg12 pg12/hifd12 hifd12 pg12/hifd12 t2 pg13 pg13/hifd13 hifd13 pg13/hifd13 r2 pg14 pg14/hifd14 hifd14 pg14/hifd14 r3 pg15 pg15/hifd15 hifd15 pg15/hifd15 u8 pg16 pg16/hifebl hifebl pg16/hifebl v6 pg17 pg17/hifrdy hifrdy pg17/hifrdy u6 pg18 pg18/hifdreq hifdreq pg18/hifdreq u7 pg19 pg19/hifint hifint pg19/hifint w5 pg20 pg20/hifrd hifrd pg20/hifrd v5 pg21 pg21/hifwr hifwr pg21/hifwr u5 pg22 pg22/hifrs hifrs pg22/hifrs u4 pg23 pg23/hifcs hifcs pg23/hifcs w8 dp ? dp ? w7 dm ? dm ? v8 vbus ? vbus ? w10 refrin ? refrin ? v11 usb_x1 ? usb_x1 ? w11 usb_x2 ? usb_x2 ?
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1001 of 1262 rej09b0437-0100 non-hif boot mode hif boot mode pin no. initial function settable function initial function settable function w17 trst ? trst ? v18 tdo ? tdo ? u16 tdi ? tdi ? w18 tms ? tms ?
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1002 of 1262 rej09b0437-0100 table 23.8 list of pins fo r each operating mode (6) non-hif boot mode hif boot mode pin no. initial function settable function initial function settable function u15 tck ? tck ? r18 asebrk/asebrkak ? asebrk/asebrkak ? t7 dg12 ? dg12 ? t8 dv12 ? dv12 ? t9 uv12 ? uv12 ? t10 av12 ? av12 ? u9 ug12 ? ug12 ? u10 ag12 ? ag12 ? v7 dg33 ? dg33 ? v9 ag33 ? ag33 ? w9 av33 ? av33 ? u19 extal ? extal ? v19 xtal ? xtal ? c19 ckio ? ckio ? m2 asemd ? asemd ? m1 testmd ? testmd ? t17 md_bw ? md_bw ? u17 md_ck1 ? md_ck1 ? u18 md_ck0 ? md_ck0 ? v17 res ? res ? t18 nmi ? nmi ? r17 wdtovf ? wdtovf ? note: * this pin functions as hifmd during a power-on reset that is output from the res pin.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1003 of 1262 rej09b0437-0100 23.1 register descriptions the pfc has the following register s. for the address and status at each processing state of these registers, see section 28, list of registers. port a i/o register h (paiorh) port a control register h2 (pacrh2) port a control register h1 (pacrh1) port b i/o register l (pbiorl) port b control register l1 (pbcrl1) port c i/o register h (pciorh) port c i/o register l (pciorl) port c control register h1 (pccrh1) port c control register l2 (pccrl2) port c control register l1 (pccrl1) port d i/o register l (pdiorl) port d control register l1 (pdcrl1) port e i/o register l (peiorl) port e control register l2 (pecrl2) port e control register l1 (pecrl1) port f i/o register l (pfiorl) port f control register l2 (pfcrl2) port f control register l1 (pfcrl1) port g i/o register h (pgiorh) port g i/o register l (pgiorl)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1004 of 1262 rej09b0437-0100 port g control register h1 (pgcrh1) port g control register l1 (pgcrl1) port g control register l2 (pgcrl2) 23.1.1 port a i/o register h (paiorh) paiorh is a 16-bit readable/writable register that selects the input/output direction for the port a pins. bits pa25ior to pa17ior correspond to pins pa25 to pa17 (multiplexed pin names other than port names are omitted), re spectively. paiorh is enabled when the function of the port a pins is set to general-purpose i/o (pa25 to pa17), and is disabled in other cases. when a bit in paiorh is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. bits 15 to 10 and 0 in paiorh are reserved. thes e bits are always read as 0. the write value should always be 0. the initial value of paiorh is h'0000.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1005 of 1262 rej09b0437-0100 23.1.2 port a control registers h2 and h1 (pacrh2, pacrh1) pacrh1 and pacrh2 are 16-bit readable/writable re gisters that select the functions of the multiplexed port a pins. ? pacrh2 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrr/wrr/w pa25 md0 pa24 md0 -- - - - - - - --- --- bit bit name initial value r/w description 15 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 pa25md0 0 r/w pa25 mode this bit selects the function of the hifmd/pa25/a25 pin. this pin functions as hifmd (hif) only during a power-on reset that is output from the res pin. 0: pa25 i/o (port) 1: a25 output (bsc) 1 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 0 pa24md0 0 r/w pa24 mode this bit selects the func tion of the pa24/a24 pin. 0: pa24 i/o (port) 1: a24 output (bsc)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1006 of 1262 rej09b0437-0100 ? pacrh1 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r/w r r/w r r/w r r/w r r/w r r/w r r/w r r pa23 md0 pa22 md0 pa21 md0 pa20 md0 pa19 md0 pa18 md0 pa17 md0 --- -- -- -- bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 pa23md0 0 r/w pa23 mode this bit selects the func tion of the pa23/a23 pin. 0: pa23 i/o (port) 1: a23 output (bsc) 13 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 12 pa22md0 0 r/w pa22 mode this bit selects the func tion of the pa22/a22 pin. 0: pa22 i/o (port) 1: a22 output (bsc) 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 10 pa21md0 0 r/w pa21 mode this bit selects the func tion of the pa21/a21 pin. 0: pa21 i/o (port) 1: a21 output (bsc) 9 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 8 pa20md0 0 r/w pa20 mode this bit selects the func tion of the pa20/a20 pin. 0: pa20 i/o (port) 1: a20 output (bsc)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1007 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 pa19md0 0 r/w pa19 mode this bit selects the func tion of the pa19/a19 pin. 0: pa19 i/o (port) 1: a19 output (bsc) 5 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 4 pa18md0 0 r/w pa18 mode this bit selects the func tion of the pa18/a18 pin. 0: pa18 i/o (port) 1: a18 output (bsc) 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 pa17md0 0 r/w pa17 mode this bit selects the func tion of the pa17/a17 pin. 0: pa17 i/o (port) 1: a17 output (bsc) 1, 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1008 of 1262 rej09b0437-0100 23.1.3 port b i/o register l (pbiorl) pbiorl is a 16-bit readable/writa ble register that selects the inpu t/output direction for the port b pins. bits pb7ior to pb0ior correspond to pins pb07 to pb00 (multiplexed pin names other than port names are omitted), respectively. pbiorl is enabled when the function of the port b pins is set to general-purpose i/o (pb07 to pb00), and is disabled in other cases. when a bit in pbiorl is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. bits 15 to 8 in pbiorl are reserved. these bits are always read as 0. the write value should always be 0. the initial value of pbiorl is h'0000.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1009 of 1262 rej09b0437-0100 23.1.4 port b control register l1 (pbcrl1) pbcrl1 is a 16-bit readable/writable register that selects the functions of the multiplexed port b pins. 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r/w r r/w r r/w r r/w r r/w r r/w r r/w r r/w pf7 md0 pf6 md0 pf5 md0 pf4 md0 pf3 md0 pf2 md0 pf1 md0 pf0 md0 -- - - ---- bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 pb7md0 0 r/w pb7 mode this bit selects the function of the pb07/bs pin. 0: pb07 i/o (port) 1: bs output (bsc) 13 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 12 pb6md0 0 r/w pb6 mode this bit selects the func tion of the pb06/cs4 pin. 0: pb06 input (port) 1: cs4 output (bsc) 11 10 pb5md1 pb5md0 0 0 r/w r/w pb5 mode these bits select the function of the pb05/cs5/ce1a/irq3/tend1 pin. 00: pb05 i/o (port) 01: cs5/ce1a output (bsc) 10: irq3 input (intc) 11: tend1 output (dmac)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1010 of 1262 rej09b0437-0100 bit bit name initial value r/w description 9 8 pb4md1 pb4md0 0 0 r/w r/w pb4 mode these bits select the function of the pb04/ce2a/irq2/dack1 pin. 00: pb04 i/o (port) 01: ce2a output (bsc) 10: irq2 input (intc) 11: dack1 output (dmac) 7 6 pb3md1 pb3md0 0 r/w pb3 mode these bits select the function of the pb03/cs6/ce1b/dreq1 pin. 00: pb03 input (port) 01: cs6/ce1b output (bsc) 10: irq1 input (intc) 11: dreq1 input (dmac) 5 4 pb2md1 pb2md0 0 0 r/w r/w pb2 mode these bits select the functi on of the pb02/ce2b/irq0 pin. 00: pb02 input (port) 01: ce2b output (bsc) 10: irq0 input (intc) 11: setting prohibited 3 2 pb1md1 pb1md0 0 0 r/w r/w pb1 mode these bits select the functi on of the pb01/iois16/scl pin. 00: pb01 input (port) 01: iois16 input (bsc) 10: scl i/o (iic) 11: setting prohibited 1 0 pb0md1 pb0md0 0 0 r/w r/w pb0 mode these bits select the functi on of the pb00/wait/sda pin. 00: pb00 input (port) 01: wait input (bsc) 10: sda i/o (iic) 11: setting prohibited
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1011 of 1262 rej09b0437-0100 23.1.5 port c i/o registers h and l (pciorh, pciorl) pciorh and pciorl are 16-bit readable/writable re gisters that select th e input/output direction for the port c pins. bits pc20ior to pc0ior correspond to pins pc20 to pc00 (multiplexed pin names other than port names are omitted), respectively. pciorh is enabled when the function of the port c pins is set to general-purpose i/o (pc20 to pc16), and is disabled in other cases. pciorl is enabled when the function of the port c pins is set to general-purpose i/o (pc15 to pc00), and is disabled in other cases. when a bit in pciorh and pciorl is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. bits 15 to 5 in pciorh are reserved. these bits are always read as 0. the write value should always be 0. the initial value of pciorh and pciorl is h'0000.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1012 of 1262 rej09b0437-0100 23.1.6 port c control registers h1, l2, and l1 (pccrh1, pccrl2, pccrl1) pccrh1, pccrl2, and pccrl1 are 16- bit readable/writable registers that select the functions of the multiplexed port c pins. ? pccrh1 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrr/wrr/wrr/wrr/wrr/w pc20 md0 pc19 md0 pc17 md0 pc16 md0 pc18 md0 -- - ----- -- - bit bit name initial value r/w description 15 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pc20md0 0 r/w pc20 mode this bit selects the func tion of the pc20/wol pin. 0: pc20 i/o (port) 1: wol output (etherc) 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 pc19md0 0 r/w pc19 mode this bit selects the function of the pc19/exout pin. 0: pc19 i/o (port) 1: exout output (etherc) 5 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 4 pc18md0 0 r/w pc18 mode this bit selects the function of the pc18/lnksta pin. 0: pc18 i/o (port) 1: lnksta input (etherc) 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1013 of 1262 rej09b0437-0100 bit bit name initial value r/w description 2 pc17md0 0 r/w pc17 mode this bit selects the function of the pc17/mdc pin. 0: pc17 i/o (port) 1: mdc output (etherc) 1 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 0 pc16md0 0 r/w pc16 mode this bit selects the function of the pc16/mdio pin. 0: pc16 i/o (port) 1: mdio i/o (etherc)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1014 of 1262 rej09b0437-0100 ? pccrl2 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r/w r r/w r r/w r r/w r r/w r r/w r r/w r r/w pc15 md0 pc14 md0 pc13 md0 pc12 md0 pc11 md0 pc10 md0 pc9 md0 pc8 md0 - - - - - - - - bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 pc15md0 0 r/w pc15 mode this bit selects the function of the pc15/crs pin. 0: pc15 i/o (port) 1: crs input (etherc) 13 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 12 pc14md0 0 r/w pc14 mode this bit selects the func tion of the pc14/col pin. 0: pc14 i/o (port) 1: col input (etherc) 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 10 pc13md0 0 r/w pc13 mode this bit selects the functi on of the pc13/tx_clk pin. 0: pc13 i/o (port) 1: tx_clk input (etherc) 9 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 8 pc12md0 0 r/w pc12 mode this bit selects the functi on of the pc12/tx_en pin. 0: pc12 i/o (port) 1: tx_en output (etherc)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1015 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 pc11md0 0 r/w pc11 mode this bit selects the functi on of the pc11/tx_er pin. 0: pc11 i/o (port) 1: tx_er output (etherc) 5 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 4 pc10md0 0 r/w pc10 mode this bit selects the functi on of the pc10/rx_clk pin. 0: pc10 i/o (port) 1: rx_clk input (etherc) 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 pc9md0 0 r/w pc9 mode this bit selects the functi on of the pc09/rx_er pin. 0: pc09 i/o (port) 1: rx_er input (etherc) 1 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 0 pc8md0 0 r/w pc8 mode this bit selects the functi on of the pc08/rx_dv pin. 0: pc08 i/o (port) 1: rx_dv input (etherc)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1016 of 1262 rej09b0437-0100 ? pccrl1 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r/w r r/w r r/w r r/w r r/w r r/w r r/w r r/w pf7 md0 pf6 md0 pf5 md0 pf4 md0 pf3 md0 pf2 md0 pf1 md0 pf0 md0 -- - - ---- bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 pc7md0 0 r/w pc7 mode this bit selects the function of the pc07/mii_txd3 pin. 0: pc07 i/o (port) 1: mii_txd3 output (etherc) 13 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 12 pc6md0 0 r/w pc6 mode this bit selects the function of the pc06/mii_txd2 pin. 0: pc06 i/o (port) 1: mii_txd2 output (etherc) 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 10 pc5md0 0 r/w pc5 mode this bit selects the function of the pc05/mii_txd1 pin. 0: pc05 i/o (port) 1: mii_txd1 output (etherc) 9 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 8 pc4md0 0 r/w pc4 mode this bit selects the function of the pc04/mii_txd0 pin. 0: pc04 i/o (port) 1: mii_txd0 output (etherc)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1017 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 pc3md0 0 r/w pc3 mode this bit selects the function of the pc03/mii_rxd3 pin. 0: pc03 i/o (port) 1: mii_rxd3 input (etherc) 5 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 4 pc2md0 0 r/w pc2 mode this bit selects the function of the pc02/mii_rxd2 pin. 0: pc02 i/o (port) 1: mii_rxd2 input (etherc) 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 pc1md0 0 r/w pc1 mode this bit selects the function of the pc01/mii_rxd1 pin. 0: pc01 i/o (port) 1: mii_rxd1 input (etherc) 1 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 0 pc0md0 0 r/w pc0 mode this bit selects the function of the pc00/mii_rxd0 pin. 0: pc00 input (port) 1: mii_rxd0 input (etherc)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1018 of 1262 rej09b0437-0100 23.1.7 port d i/o register l (pdiorl) pdiorl is a 16-bit readable/writable register that selects the input/output direction for the port d pins. bits pd7ior to pd0ior correspond to pins pd07 to pd00 (multiplexed pin names other than port names are omitted), respectively. pdiorl is enabled when the function of the port d pins is set to general-purpose i/o (pd07 to pd00), and is disabled in other cases. when a bit in pdiorl is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. bits 15 to 8 in pdiorl are reserved. these bits are always read as 0. the write value should always be 0. the initial value of pdiorl is h'0000.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1019 of 1262 rej09b0437-0100 23.1.8 port d control register l1 (pdcrl1) pdcrl1 is a 16-bit readable/writable register that selects the functions of the multiplexed port d pins. 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pd7 md0 pd6 md0 pd5 md1 pd5 md0 pd4 md1 pd4 md0 pd3 md1 pd3 md0 pd2 md1 pd2 md0 pd1 md1 pd1 md0 pd0 md1 pd0 md0 pd7 md1 pd6 md1 bit bit name initial value r/w description 15 14 pd7md1 pd7md0 0 0 r/w r/w pd7 mode these bits select the function of the pd07/irq7/sdclk pin. 00: pd07 i/o (port) 01: irq7 input (intc) 10: sdclk output (sdhi) 11: setting prohibited 13 12 pd6md1 pd6md0 0 0 r/w r/w pd6 mode these bits select the function of the pd06/irq6/sdcmd pin. 00: pd06 i/o (port) 01: irq6 input (intc) 10: sdcmd i/o (sdhi) 11: setting prohibited 11 10 pd5md1 pd5md0 0 0 r/w r/w pd5 mode these bits select the function of the pd05/irq5/sdcd pin. 00: pd05 input (port) 01: irq5 input (intc) 10: sdcd input (sdhi) 11: setting prohibited
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1020 of 1262 rej09b0437-0100 bit bit name initial value r/w description 9 8 pd4md1 pd4md0 0 0 r/w r/w pd4 mode these bits select the function of the pd04/irq4/sdwp pin. 00: pd04 input (port) 01: irq4 input (intc) 10: sdwp input (sdhi) 11: setting prohibited 7 6 pd3md1 pd3md0 0 0 r/w r/w pd3 mode these bits select the function of the pd03/irq3/sddata3 pin. 00: pd03 i/o (port) 01: irq3 input (intc) 10: sddata3 i/o (sdhi) 11: setting prohibited 5 4 pd2md1 pd2md0 0 0 r/w r/w pd2 mode these bits select the function of the pd02/irq2/sddata2 pin. 00: pd02 i/o (port) 01: irq2 input (intc) 10: sddata2 i/o (sdhi) 11: setting prohibited 3 2 pd1md1 pd1md0 0 0 r/w r/w pd1 mode these bits select the function of the pd01/irq1/sddata1 pin. 00: pd01 i/o (port) 01: irq1 input (intc) 10: sddata1 i/o (sdhi) 11: setting prohibited 1 0 pd0md1 pd0md0 0 0 r/w r/w pd0 mode these bits select the function of the pd00/irq0/sddata0 pin. 00: pd00 i/o (port) 01: irq0 input (intc) 10: sddata0 i/o (sdhi) 11: setting prohibited
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1021 of 1262 rej09b0437-0100 23.1.9 port e i/o re gister l (peiorl) peiorl is a 16-bit readable/writable register that selects the input/output direction for the port e pins. bits pe11ior to pe0ior correspond to pins pe11 to pe00 (multiplexed pin names other than port names are omitted), respectively. peiorl is enabled when the function of the port e pins is set to general-purpose i/o (pe11 to pe00), and is disabled in other cases. when a bit in peiorl is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. bits 15 to 12 in peiorl are reserved. these bits are always read as 0. the write value should always be 0. the initial value of peiorl is h'0000.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1022 of 1262 rej09b0437-0100 23.1.10 port e control registers l2 and l1 (pecrl2, pecrl1) pecrl2 and pecrl1 are 16-bit readable/writable re gisters that select the functions of the multiplexed port e pins. ? pecrl2 1514131211109876543210 bit: initial value: r/w: 0000000001000000 rrrrr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wrr/w pe13 md1 pe13 md0 pe12 md1 pe12 md0 pe11 md1 pe11 md0 pe10 md1 pe10 md0 pe09 md1 pe09 md0 pe08 md0/w pe08 md1 - - - - bit bit name initial value r/w description 15 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 10 pe13md1 pe13md0 0 0 r/w r/w pe13 mode these bits select the func tion of the st1_clk/ssisck1 pin. 00: setting prohibited 01: st1_clk i/o (stif) 10: ssisck1 i/o (ssi) 11: setting prohibited 9 8 pe12md1 pe12md0 0 0 r/w r/w pe12 mode these bits select the function of the st1_vco_clkin/audio_clk pin. 00: setting prohibited 01: st1_vco_clkin input (stif) 10: audio_clk input (ssi) 11: setting prohibited 7 6 pe11md1 pe11md0 0 1 r/w r/w pe11 mode these bits select the function of the pe11/st1_pwm/rts2 pin. 00: pe11 i/o (port) 01: st1_pwm output (stif) 10: rts2 i/o (scif) 11: setting prohibited
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1023 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 4 pe10md1 pe10md0 0 0 r/w r/w pe10 mode these bits select the function of the pe10/st1_syc/cts2 pin. 00: pe10 i/o (port) 01: st1_syc i/o (stif) 10: cts2 i/o (scif) 11: setting prohibited 3 2 pe09md1 pe09md0 0 0 r/w r/w pe09 mode these bits select the func tion of the pe09/st1_vld/sck2 pin. 00: pe09 i/o (port) 01: st1_vld i/o (stif) 10: sck2 i/o (scif) 11: setting prohibited 1 0 pe08md1 pe08md0 0 0 r/w r/w pe08 mode these bits select the functi on of the pe08/st1_req pin. 00: pe08 i/o (port) 01: st1_req i/o (stif) 10: txd2 output (scif) 11: setting prohibited
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1024 of 1262 rej09b0437-0100 ? pecrl1 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pe7 md0 pe6 md0 pe5 md1 pe5 md0 pe4 md1 pe4 md0 pe3 md1 pe3 md0 pe2 md1 pe2 md0 pe1 md1 pe1 md0 pe0 md1 pe0 md0 pe7 md1 pe6 md1 bit bit name initial value r/w description 15 14 pe07md1 pe07md0 0 0 r/w pe07 mode these bits select the function of the pe07/st1_d7/ssiws1 pin. 00: pe07 i/o (port) 01: ts2_d7 i/o (stif) 10: ssiws1 i/o (ssi) 11: setting prohibited 13 12 pe06md1 pe06md0 0 0 r/w r/w pe06 mode these bits select the function of the pe06/st1_d6/ssidata1 pin. 00: pe06 i/o (port) 01: st1_d6 i/o (stif) 10: ssidata1 i/o (ssi) 11: setting prohibited 11 10 pe05md1 pe05md0 0 0 r/w r/w pe05 mode these bits select the func tion of the pe05/st1_d5/rts1 pin. 00: pe05 i/o (port) 01: st1_d5 i/o (stif) 10: rts1 i/o (scif) 11: setting prohibited 9 8 pe04md1 pe04md0 0 0 r/w r/w pe04 mode these bits select the func tion of the pe04/st1_d4/cts1 pin. 00: pe04 i/o (port) 01: st1_d4 i/o (stif) 10: cts1 i/o (scif) 11: setting prohibited
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1025 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 6 pe03md0 pe03md0 0 0 r/w r/w pe03 mode these bits select the func tion of the pe03/st1_d3/sck1 pin. 00: pe03 i/o (port) 01: st1_d3 i/o (stif) 10: sck1 i/o (scif) 11: setting prohibited 5 4 pe02md1 pe02md0 0 0 r/w r/w pe02 mode these bits select the func tion of the pe02/st1_d2/rxd1 pin. 00: pe02 i/o (port) 01: st1_d2 i/o (stif) 10: rxd1 input (scif) 11: setting prohibited 3 2 pe01md1 pe01md0 0 0 r/w r/w pe01 mode these bits select the func tion of the pe01/st1_d1/txd1 pin. 00: pe01 i/o (port) 01: st1_d1 i/o (stif) 10: txd1 output (scif) 11: setting prohibited 1 0 pe00md1 pe00md0 0 0 r/w r/w pe00 mode these bits select the func tion of the pe00/st1_d0 pin. 00: pe00 i/o (port) 01: st1_d0 i/o (stif) 10: rxd2 input (scif) 11: setting prohibited
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1026 of 1262 rej09b0437-0100 23.1.11 port f i/o register l (pfiorl) pfiorl is a 16-bit readable/writable register that selects the input/output direction for the port f pins. bits pf11ior to pf0ior correspond to pins pf11 to pf00 (multiplexed pin names other than port names are omitted), re spectively. pfiorl is enabled when the function of the port f pins is set to general-purpose i/o (pf11 to pf00), and is disabled in other cases. when a bit in pfiorl is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. bits 15 to 12 in pfiorl are reserved. these bits are always read as 0. the write value should always be 0. the initial value of pfiorl is h'0000.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1027 of 1262 rej09b0437-0100 23.1.12 port f control registers l2 and l1 (pfcrl2, pfcrl1) pfcrl2 and pfcrl1 are 16-bit readable/writable re gisters that select the functions of the multiplexed port f pins. ? pfcrl2 1514131211109876543210 bit: initial value: r/w: 0000000001000000 rrrrr/wr/wrrr/wr/wr/wr/wr/wr/wrr/w pf13 md1 pf13 md0 pf11 md1 pf11 md0 pf10 md1 pf10 md0 pf09 md1 pf09 md0 pf08 md0 ---- - - - bit bit name initial value r/w description 15 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 10 pf13md1 pf13md0 0 0 r/w r/w pf13 mode these bits select the func tion of the st0_clk/ssisck0 pin. 00: setting prohibited 01: st0_clk i/o (stif) 10: ssisck0 i/o (ssi) 11: setting prohibited 9, 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 6 pf11md1 pf11md0 0 1 r/w r/w pf11 mode these bits select the function of the pf11/st0_pwm/tend0 pin. 00: pe11 i/o (port) 01: st0_pwm output (stif) 10: tend0 output (dmac) 11: setting prohibited
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1028 of 1262 rej09b0437-0100 bit bit name initial value r/w description 5 4 pf10md1 pf10md0 0 0 r/w r/w pf10 mode these bits select the function of the pf10/st0_syc/dack0 pin. 00: pf10 i/o (port) 01: st0_syc i/o (stif) 10: dack0 output (dmac) 11: setting prohibited 3 2 pf09md1 pf09md0 0 0 r/w r/w pf09 mode these bits select the function of the pf09/st0_vld/dreq0 pin. 00: pf09 i/o (port) 01: st0_vld i/o (stif) 10: dreq0 input (dmac) 11: setting prohibited 1 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 0 pf08md0 0 r/w pf08 mode this bit selects the functi on of the pf08/st0_req pin. 0: pf08 i/o (port) 1: st0_req i/o (stif)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1029 of 1262 rej09b0437-0100 ? pfcrl1 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r r/w pf7 md0 pf6 md0 pf5 md1 pf5 md0 pf4 md1 pf4 md0 pf3 md1 pf3 md0 pf2 md1 pf2 md0 pf1 md1 pf1 md0 pf0 md0 pf7 md1 pf6 md1 - bit bit name initial value r/w description 15 14 pf07md1 pf07md0 0 0 r/w r/w pf07 mode these bits select the function of the pf07/st0_d7/ssiws0 pin. 00: pf07 i/o (port) 01: st0_d7 i/o (stif) 10: ssiws0 i/o (ssi) 11: setting prohibited 13 12 pf06md1 pf06md0 0 0 r/w r/w pf06 mode these bits select the function of the pf06/st0_d6/ssidata0 pin. 00: pf06 i/o (port) 01: st0_d6 i/o (stif) 10: ssidata0 i/o (ssi) 11: setting prohibited 11 10 pf05md1 pf05md0 0 0 r/w r/w pf05 mode these bits select the func tion of the pf 05/st0_d5/rts0 pin. 00: pf05 i/o (port) 11: st0_d5 i/o (stif) 10: rts0 i/o (scif) 11: setting prohibited 9 8 pf04md1 pf04md0 0 0 r/w r/w pf04 mode these bits select the func tion of the pf 04/st0_d4/cts0 pin. 00: pf04 i/o (port) 01: st0_d4 i/o (stif) 10: cts0 i/o (scif) 11: setting prohibited
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1030 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 6 pf03md1 pf03md0 0 0 r/w r/w pf03 mode these bits select the func tion of the pf03/st0_d3/sck0 pin. 00: pf03 i/o (port) 01: st0_d3 i/o (stif) 10: sck0 i/o (scif) 11: setting prohibited 5 4 pf02md1 pf02md0 0 0 r/w r/w pf02 mode these bits select the func tion of the pf02/st0_d2/rxd0 pin. 0: pf02 i/o (port) 1: st0_d2 i/o (stif) 10: rxd0 input (scif) 11: setting prohibited 3 2 pf01md1 pf01md0 0 r/w pf01 mode these bits select the func tion of the pf01/st0_d1/txd0 pin. 00: pf01 i/o (port) 01: st0_d1 i/o (stif) 10: txd0 output (scif) 11: setting prohibited 1 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 0 pf00md0 0 r/w pf00 mode this bit selects the functi on of the pf00/st0_d0 pin. 0: pf00 i/o (port) 1: st0_d0 i/o (stif)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1031 of 1262 rej09b0437-0100 23.1.13 port g i/o registers h and l (pgiorh, pgiorl) pgiorh and pgiorl are 16-bit re adable/writable registers that se lect the input/output direction for the port g pins. bits pg23ior to pg0ior correspond to pins pg23 to pg00 (multiplexed pin names other than port names are omitted), respectively. pgiorh is enabled when the function of the port g pins is set to general-purpose i/o (pg23 to pg16), and is disabled in other cases. pgiorl is enabled when the function of the port g pins is set to general-purpose i/o (pg15 to pg00), and is disabled in other cases. when a bit in pgiorh and pgiorl is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. bits 15 to 8 in pgiorh are reserved. these bits are always read as 0. the write value should always be 0. the initial value of pgiorh and pgiorl is h'0000.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1032 of 1262 rej09b0437-0100 23.1.14 port g control registers h2, l2, and l1 (pgcrh2, pgcrl2, pgcrl1) pgcrh2, pgcrl1, and pgcrl2 are 16- bit readable/writable register s that select the functions of the multiplexed port g pins. ? pgcrh2 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r/w r r/w r r/w r r/w r r/w r r/w r r/w r r/w pg23 md0 pg22 md0 pg21 md0 pg20 md0 pg19 md0 pg18 md0 pg17 md0 pg16 md0 - - - - - - - - bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 pg23md0 0 r/w pg23 mode this bit selects the functi on of the pg23/hifcs pin. 0: pg23 i/o (port) 1: hifcs input (hif) 13 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 12 pg22md0 0 r/w pg22 mode this bit selects the functi on of the pg22/hifrs pin. 0: pg22 i/o (port) 1: hifrs input (hif) 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 10 pg21md0 0 r/w pg21 mode this bit selects the functi on of the pg21/hifwr pin. 0: pg22 i/o (port) 1: hifwr input (hif) 9 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1033 of 1262 rej09b0437-0100 bit bit name initial value r/w description 8 pg20md0 0 r/w pg20 mode this bit selects the functi on of the pg20/hifrd pin. 0: pg20 i/o (port) 1: hifrd input (hif) 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 pg19md0 0 r/w pg19 mode this bit selects the functi on of the pg19/hifint pin. 0: pg19 i/o (port) 1: hifint output (hif) 5 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 4 pg18md0 0 r/w pg18 mode this bit selects the functi on of the pg18/hifdreq pin. 0: pg18 i/o (port) 1: hifdreq output (hif) 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 pg17md0 0 r/w pg17 mode this bit selects the functi on of the pg17/hifrdy pin. 0: pg17 i/o (port) 1: hifrdy output (hif) 1 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 0 pg16md0 0 r/w pg16 mode this bit selects the functi on of the pg16/hifebl pin. 0: pg16 i/o (port) 1: hifebl input (hif)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1034 of 1262 rej09b0437-0100 ? pgcrl2 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r/w r r/w r r/w r r/w r r/w r r/w r r/w r r/w pg15 md0 pg14 md0 pg13 md0 pg12 md0 pg11 md0 pg10 md0 pg9 md0 pg8 md0 - - - - - - - - bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 pg15md0 0 r/w pg15 mode this bit selects the functi on of the pg15/hifd15 pin. 0: pg15 i/o (port) 1: hifd15 i/o (hif) 13 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 12 pg14md0 0 r/w pg14 mode this bit selects the functi on of the pg14/hifd14 pin. 0: pg14 i/o (port) 1: hifd14 i/o (hif) 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 10 pg13md0 0 r/w pg13 mode this bit selects the functi on of the pg13/hifd13 pin. 0: pg13 i/o (port) 1: hifd13 i/o (hif) 9 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 8 pg12md0 0 r/w pg12 mode this bit selects the functi on of the pg12/hifd12 pin. 0: pg12 i/o (port) 1: hifd12 i/o (hif)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1035 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 pg11md0 0 r/w pg11 mode this bit selects the functi on of the pg11/hifd11 pin. 0: pg11 i/o (port) 1: hifd11 i/o (hif) 5 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 4 pg10md0 0 r/w pg10 mode this bit selects the functi on of the pg10/hifd10 pin. 0: pg10 i/o (port) 1: hifd10 i/o (hif) 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 pg09md0 0 r/w pg09 mode this bit selects the functi on of the pg09/hifd09 pin. 0: pg09 i/o (port) 1: hifd09 i/o (hif) 1 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 0 pg08md0 0 r/w pg08 mode this bit selects the functi on of the pg08/hifd08 pin. 0: pg08 i/o (port) 1: hifd08 i/o (hif)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1036 of 1262 rej09b0437-0100 ? pgcrl1 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r/w r r/w r r/w r r/w r r/w r r/w r r/w r r/w pg7 md0 pg6 md0 pg5 md0 pg4 md0 pg3 md0 pg2 md0 pg1 md0 pg0 md0 - - - - - - - - bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 pg07md0 0 r/w pg07 mode this bit selects the functi on of the pg07/hifd07 pin. 0: pg07 i/o (port) 1: hifd07 i/o (hif) 13 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 12 pg06md0 0 r/w pg06 mode this bit selects the functi on of the pg06/hifd06 pin. 0: pg06 i/o (port) 1: hifd06 i/o (hif) 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 10 pg05md0 0 r/w pg05 mode this bit selects the functi on of the pg05/hifd05 pin. 0: pg05 i/o (port) 1: hifd05 i/o (hif) 9 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 8 pg04md0 0 r/w pg04 mode this bit selects the functi on of the pg04/hifd04 pin. 0: pg04 i/o (port) 1: hifd04 i/o (hif)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1037 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 pg03md0 0 r/w pg03 mode this bit selects the functi on of the pg03/hifd03 pin. 0: pg03 i/o (port) 1: hifd03 i/o (hif) 5 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 4 pg02md0 0 r/w pg02 mode this bit selects the functi on of the pg02/hifd02 pin. 0: pg02 i/o (port) 1: hifd02 i/o (hif) 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 pg01md0 0 r/w pg01 mode this bit selects the functi on of the pg01/hifd01 pin. 0: pg01 i/o (port) 1: hifd01 i/o (hif) 1 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 0 pg00md0 0 r/w pg00 mode this bit selects the functi on of the pg00/hifd00 pin. 0: pg00 i/o (port) 1: hifd00 i/o (hif)
section 23 pin function controller (pfc) rev. 1.00 nov. 14, 2007 page 1038 of 1262 rej09b0437-0100
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1039 of 1262 rej09b0437-0100 section 24 i/o ports this lsi has seven general i/o ports: a to g. port a is an 9-bit i/o port, port b an 8-bit i/o port, port c a 21-bit i/o port, port d an 8-bit i/o port, port e a 12-bit i/ o port, port f a 12-bit i/o port and port g a 24-bit i/o port. all port pins are multiplexed with other pin functions. the functions of the multiplexed pins are selected using the pin function controller (pfc). each port is provided with a data register for storing the pin data. 24.1 port a port a is an i/o port with 9 pins shown in figure 24.1. pa17 (input/output)/ a17 (output) pa18 (input/output)/ a18 (output) pa19 (input/output)/ a19 (output) pa20 (input/output)/ a20 (output) pa21 (input/output)/ a21 (output) pa22 (input/output)/ a22 (output) pa23 (input/output / a23 (output pa24 (input/output)/ a24 (output) pa25 (input/output)/ a25 (output) port a figure 24.1 port a 24.1.1 register descriptions port a is a 9-bit i/o port. port a has the following register. refer to section 28, list of registers, for more details on the addresses and states of this register in each operating mode. port a data register h (padrh)
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1040 of 1262 rej09b0437-0100 24.1.2 port a data register h (padrh) padrh is a 16-bit readable/writable register that stores port a data. bits pa25dr to pa17dr correspond to pins pa25 to pa17, respectively (description of the other functions are omitted). if a pin is set to the general output function, the pin will output the value written to the corresponding bit in padrh, and the register value is read from padrh regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if padrh is read. also, if a value is written to padrh, although the value will actually be written, it will have no influence on the state of the pin.table 24.1 summarizes the padrh read/write operations. 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrr/wr/wr/wr/wr/wr/wr/wr/w -- --- - pb7 dr pb6 dr pb5 dr pb4 dr pb3 dr pb2 dr pb1 dr pb0 dr -- bit bit name initial value r/w description 15 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 pa25dr 0 r/w 8 pa24dr 0 r/w 7 pa23dr 0 r/w 6 pa22dr 0 r/w 5 pa21dr 0 r/w 4 pa20dr 0 r/w 3 pa19dr 0 r/w 2 pa18dr 0 r/w 1 pa17dr 0 r/w see table 24.1. 0 ? 0 r reserved these bits are always read as 0. the write value should always be 0.
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1041 of 1262 rej09b0437-0100 table 24.1 port a data regist ers h (padrh) read/write operations bits 9 to 1 of padrh pin function paiorh read write general input 0 pin state the value is written to padrh but there is no effect on the pin state. general output 1 value of padrh the value written is output from the pin. other functions * value of padrh the value is written to padrh but there is no effect on the pin state.
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1042 of 1262 rej09b0437-0100 24.2 port b port b is an i/o port with 8 pins shown in figure 24.2. pb07 (input/outpu)/ bs (output) pb06 (input)/ cs4 (output) pb05 (input/output)/ cs5 (output)/ ce1a (output)/irq3 (input)/tend1 (output) pb02 (input)/ se2b (output)/irq1 (input) pb03 (input)/ cs6 (output)/ ce1b (output)/irq1 (input)/dreq1 (input) pb04 (input/output)/ ce2a (output)/irq2 (input)/dack1 (output) pb01 (input)/ iois16 (input)/scl (input/output) pb00 (input)/ wait (input)/sda (input/output) port b figure 24.2 port b 24.2.1 register descriptions port b is an 8-bit i/o port. port b has the following register. refer to section 28, list of registers, for more details on the addresses and states of this register in each operating mode. port b data register l (pbdrl)
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1043 of 1262 rej09b0437-0100 24.2.2 port b data register l (pbdrl) pbdrl is a 16-bit readable/writable register th at stores port b data. bits pb7dr to pb0dr correspond to pins pb07 to pb00, respectively (description of the other functions are omitted). if a pin is set to the general output function, the pin will output the value written to the corresponding bit in pbdrl, and the register valu e is read from pbdrl regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if pbdrl is read. also, if a value is written to pbdrl, although the value will actually be written, it will have no influence on the state of the pin.table 24.2 summarizes the pbdrl read/write operations. 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrr/wr/wr/wr/wr/wr/wr/wr/w -- --- - pb7 dr pb6 dr pb5 dr pb4 dr pb3 dr pb2 dr pb1 dr pb0 dr -- bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 pb7dr 0 r/w see table 24.2. 6 pb6dr 0 r/w 5 pb5dr 0 r/w 4 pb4dr 0 r/w 3 pb3dr 0 r/w 2 pb2dr 0 r/w 1 pb1dr 0 r/w 0 pb0dr 0 r/w
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1044 of 1262 rej09b0437-0100 table 24.2 port b data regist ers l (pbdrl) read/write operations bits 7, 5 and 4 of pbdrl pin function pbiorl read write general input 0 pin state the value is written to pbdrl but there is no effect on the pin state. general output 1 value of pbdrl the va lue written is output from the pin. other functions * value of pbdrl the value is wr itten to pbdrl but there is no effect on the pin state. bits 6 and 3 to 0 of pbdrl pin function pbiorl read write general input 0 pin state the value is written to pbdrl but there is no effect on the pin state. setting prohibited 1 ? ? other functions * value of pbdrl the value is wr itten to pbdrl but there is no effect on the pin state.
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1045 of 1262 rej09b0437-0100 24.3 port c port c is an i/o port with 21 pins shown in figure 24.3. pc09(input/output)/rx_er (input) pc08(input/output)/rx_dv (input) pc07(input/output)/mii_txd3 (output) pc06(input/output)/mii_txd2 (output) pc05(input/output)/mii_txd1 (output) pc02(input/output)/mii_rxd2 (input) pc03(input/output)/mii_rxd3 (input) pc04(input/output)/mii_txd0 (output) pc01(input/output)/mii_rxd1 (input) pc00(input/output)/mii_rxd0 (input) pc10(input/output)/rx_clk( input) pc11(input/output)/tx_er (output) pc12(input/output)/tx_en (output) pc13(input/output)/x_clk (input) pc14(input/output)col (input) pc15(input/output)/crs(input) pc16(input/output)/mdio (input/output) pc17(input/output)/mdc (output) pc18(input/output)/lnksta (input) pc19(input/output)/exout (output) pc20(input/output)/wol (output) port c figure 24.3 port c 24.3.1 register descriptions port c is a 21-bit i/o port. port c has the foll owing registers. refer to section 28, list of registers, for more details on the addresses and states of these register s in each operating mode. port c data register h (pcdrh) port c data register l (pcdrl)
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1046 of 1262 rej09b0437-0100 24.3.2 port c data registers h and l (pcdrh and pcdrl) pcdrh and pcdrl are 16-bit readable/writable regi sters that store port c data. bits pc20dr to pc0dr correspond to pins pc20 to pc00, respectively (description of the other functions are omitted). if a pin is set to the general output function, the pin will output the value written to the corresponding bit in pcdrh or pcdrl, and the register value is read from pcdrh or pcdrl regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if pcdrh or pcdrl is read. also, if a value is written to pcdrh or pcdrl, although the value will actually be written, it will have no influence on the state of the pin.table 24.3 summarizes the pcdrh and pcdrl read/write operations. ? pcdrh 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrr/wr/wr/wr/wr/w -- ---- pc20 dr pc19 dr pc18 dr pc17 dr pc16 dr - -- - - bit bit name initial value r/w description 15 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pc20dr 0 r/w see table 24.3. 3 pc19dr 0 r/w 2 pc18dr 0 r/w 1 pc17dr 0 r/w 0 pc16dr 0 r/w
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1047 of 1262 rej09b0437-0100 ? pcdrl 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pc8 dr pc15 dr pc14 dr pc13 dr pc12 dr pc11 dr pc10 dr pc9 dr pc2 dr pc1 dr pc0 dr pc7 dr pc6 dr pc5 dr pc4 dr pc3 dr bit bit name initial value r/w description 15 pc15dr 0 r/w see table 24.3. 14 pc14dr 0 r/w 13 pc13dr 0 r/w 12 pc12dr 0 r/w 11 pc11dr 0 r/w 10 pc10dr 0 r/w 9 pc9dr 0 r/w 8 pc8dr 0 r/w 7 pc7dr 0 r/w 6 pc6dr 0 r/w 5 pc5dr 0 r/w 4 pc4dr 0 r/w 3 pc3dr 0 r/w 2 pc2dr 0 r/w 1 pc1dr 0 r/w 0 pc0dr 0 r/w
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1048 of 1262 rej09b0437-0100 table 24.3 port c data registers h and l (pcdrh and pcdrl) read/write operations bits 4 to 0 of pcdrh and bits 15 to 1 of pcdrl pin function pciorh, l read write general input 0 pin state the value is written to pcdrh or pcdrl but there is no effect on the pin state. general output 1 value of pcdrh or pcdrl the value written is output from the pin. other functions * value of pcdrh or pcdrl the value is written to pcdrh or pcdrl but there is no effect on the pin state. bit 0 of pcdrl pin function pciorl read write general input 0 pin state the value is wr itten to pcdrl but there is no effect on the pin state. setting prohibited 1 ? ? other functions * value of pcdrl the value is written to pcdrl but there is no effect on the pin state.
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1049 of 1262 rej09b0437-0100 24.4 port d port d is an i/o port with 8 pins shown in figure 24.4. pd0 (input/output)/ irq0 (input)/sddat0 (input/output) pd1 (input/output)/ irq1 (input)/sddat1 (input/output) pd2 (input/output)/ irq2 (input)/sdda2 (input/output) pd3 (input/output)/ irq3 (input)/sdda3 (input/output) pd4 (input)/ irq4 (input)/ sdwp (input) pd5 (input)/ irq5 (input)/ sdcd (input) pd6 (input/output)/ irq6 (input)/sdcmd (input/output) pd7 (input/output)/ irq7 (input)/sdclk (output) port d figure 24.4 port d 24.4.1 register descriptions port d is an 8-bit i/o port. port d has the following register. refer to section 28, list of registers, for more details on the addresses and states of this register in each operating mode. port d data register l (pddrl)
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1050 of 1262 rej09b0437-0100 24.4.2 port d data register l (pddrl) pddrl is a 16-bit readable/writable register th at stores port d data. bits pd7dr to pd0dr correspond to pins pd7 to pd0, respectively (description of the other functions are omitted). if a pin is set to the general output function, the pin will output the value written to the corresponding bit in pddrl, and the register valu e is read from pddrl regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if pddrl is read. also, if a value is written to pddrl, although the value will actually be written, it will have no influence on the state of the pin.table 24.4 summarizes the pddrl read/write operations. 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrr/wr/wr/wr/wr/wr/wr/wr/w -- -- -- pd7 dr pd6 dr pd5 dr pd4 dr pd3 dr pd2 dr pd1 dr pd0 dr -- bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 pd7dr 0 r/w see table 24.4. 6 pd6dr 0 r/w 5 pd5dr 0 r/w 4 pd4dr 0 r/w 3 pd3dr 0 r/w 2 pd2dr 0 r/w 1 pd1dr 0 r/w 0 pd0dr 0 r/w
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1051 of 1262 rej09b0437-0100 table 24.4 port d data regist ers l (pddrl) read/write operations bits 7, 6, and 3 to 0 of pddrl pin function pdiorl read write general input 0 pin state the value is written to pddrl but there is no effect on the pin state. general output 1 value of pddrl the va lue written is output from the pin. other functions * value of pddrl the value is wr itten to pddrl but there is no effect on the pin state. bits 5 and 4 of pddrl pin function pdiorl read write general input 0 pin state the value is written to pddrl but there is no effect on the pin state. setting prohibited 1 ? ? other functions * value of pddrl the valu e is written to pddrl but there is no effect on the pin state.
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1052 of 1262 rej09b0437-0100 24.5 port e port e is an i/o port with 12 pins shown in figure 24.5. pe00 (input/output)/ ts1_d0 (input)/rxd2 (input) pe01 (input/output)/ ts1_d1 (output)/txd2 (output) pe02 (input/output)/ts1_d2 (input)/rxd1 (input) pe03 (input/output)/ ts1_d3 (input/output)/ sck1 (input/output) pe04 (input/output)/ ts1_d4 (input/output)/ cts1 (input/output) pe05 (input/output)/ts1_d5 (input/output)/ rts1 (input/output) pe06 (input/output)/ ts1_d6 (input/output)/ssidata1 (input/output) pe07 (input/output)/ ts1_d7 (input/output)/ssiws1 (input/output) pe08 (input/output)/ ts1_req (output)/txd2 (output) pe09 (input/output)/ ts1_vld (input/output)/sck2 (input/output) pe11 (input/output)/ ts1_pwm (output)/ rts2 (input/output) port e pe10 (input/output)/ ts1_syc (input/output)/ cts2 (input/output) figure 24.5 port e 24.5.1 register descriptions port e is a 12-bit i/o port. port e has the following register. refer to section 28, list of registers, for more details on the addresses and states of this register in each operating mode. port e data register l (pedrl)
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1053 of 1262 rej09b0437-0100 24.5.2 port e data register l (pedrl) pedrl is a 16-bit readable/writable register th at stores port e data. bits pe11dr to pe0dr correspond to pins pe11 to pe00, respectively (description of the other functions are omitted). if a pin is set to the general output function, the pin will output the value written to the corresponding bit in pedrl, and th e register value is read from pedrl regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if pedrl is read. also, if a value is written to pedrl, although the value will actually be written, it will have no influence on the state of the pin.table 24.5 summarizes the pedrl read/write operations. 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w -- -- pe9 dr pe8 dr pe7 dr pe6 dr pe5 dr pe4 dr pe3 dr pe2 dr pe11 dr pe10 dr pe1 dr pe0 dr bit bit name initial value r/w description 15 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 pe11dr 0 r/w see table 24.5. 10 pe10dr 0 r/w 9 pe9dr 0 r/w 8 pe8dr 0 r/w 7 pe7dr 0 r/w 6 pe6dr 0 r/w 5 pe5dr 0 r/w 4 pe4dr 0 r/w 3 pe3dr 0 r/w 2 pe2dr 0 r/w 1 pe1dr 0 r/w 0 pe0dr 0 r/w
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1054 of 1262 rej09b0437-0100 table 24.5 port e data regist ers l (pedrl) read/write operations bits 11 and 0 of pedrl pin function peiorl read write general input 0 pin state the value is wr itten to pedrl but there is no effect on the pin state. general output 1 value of pedrl the value written is output from the pin. other functions * value of pedrl the value is written to pedrl but there is no effect on the pin state.
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1055 of 1262 rej09b0437-0100 24.6 port f port f is an i/o port with 12 pins shown in figure 24.6. pf00 (input/outoput)/ ts0_d0 (input/output) pf01 (input/outoput)/ ts0_d1 (output)/txd0 (output) pf02 (input/outoput)/ ts0_d2 (input/output)/rxd0 (input) pf03 (input/outoput)/ ts0_d3 (input/output)/scko0 (input/output) pf04 (input/outoput)/ ts0_d4 (input/output)/cts0 (input/output) pf05 (input/outoput)/ ts0_d5 (input/output)/rts0 (input/output) pf06 (input/outoput)/ ts0_d6 (input/output)/ssidata0 (input/output) pf07 (input/outoput)/ ts0_d7 (input/output)/ssiws0 (input/output) pf08 (input/outoput)/ ts0_req (input/output) pf09 (input/outoput)/ ts0_vld (input/output)/dreq0 (input) pf10 (input/outoput)/ ts0_syc (input/output)/dack0 (output) pf11 (input/outoput)/ ts0_pwm (output)/tend0 (output) port f figure 24.6 port f 24.6.1 register descriptions port f is an 12-bit i/o port. port f has the following register. refer to section 28, list of registers, for more details on the addresses and states of this register in each operating mode. port f data register l (pfdrl)
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1056 of 1262 rej09b0437-0100 24.6.2 port f data register l (pfdrl) pfdrl is a 16-bit readable/writable register that stores port f data. bits pf11dr to pf0dr correspond to pins pf11 to pf00, respectively (description of the other functions are omitted). if a pin is set to the general output function, the pin will output the value written to the corresponding bit in pfdrl, and the register valu e is read from pfdrl regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if pfdrl is read. also, if a value is written to pfdrl, although the value will actually be written, it will have no influence on the state of the pin.table 24.6 summarizes the pfdrl read/write operations. 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w -- -- pf9 dr pf8 dr pf7 dr pf6 dr pf5 dr pf4 dr pf3 dr pf2 dr pf11 dr pf10 dr pf1 dr pf0 dr bit bit name initial value r/w description 15 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 pf11dr 0 r/w see table 24.6. 10 pf10dr 0 r/w 9 pf9dr 0 r/w 8 pf8dr 0 r/w 7 pf7dr 0 r/w 6 pf6dr 0 r/w 5 pf5dr 0 r/w 4 pf4dr 0 r/w 3 pf3dr 0 r/w 2 pf2dr 0 r/w 1 pf1dr 0 r/w 0 pf0dr 0 r/w
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1057 of 1262 rej09b0437-0100 table 24.6 port f data regist ers l (pfdrl) read/write operations bits 11 and 0 of pfdrl pin function pfiorl read write general input 0 pin state the value is wr itten to pfdrl but there is no effect on the pin state. general output 1 value of pfdrl the value written is output from the pin. other functions * value of pfdrl the value is written to pfdrl but there is no effect on the pin state.
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1058 of 1262 rej09b0437-0100 24.7 port g port g is an i/o port with 24 pins shown in figure 24.7. pc09 (input/output)/hifd09 (input/output) pc08 (input/output)/hifd08 (input/output) pc07 (input/output)/hifd07 (input/output) pc06 (input/output)/hifd06 (input/output) pc05 (input/output)/hifd05 (input/output) pc04 (input/output)/hifd04 (input/output) pc10 (input/output)/hifd10 (input/output) pc11 (input/output)/hifd11 (input/output) pc12( input/output)/hifd12 (input/output) pc13 (input/output)/hifd13 (input/output) pc14 (input/output)/hifd14 (input/output) pc15( input/output)/hifd15 (input/output) pc16 (input/output)/hifebl (input) pc17(input/output)/hifrdy (output) pc18 (input/output)/hifdreq (output) pc19 (input/output)/ hifint (output) pc20 (input/output)/ hifrd (input) pc23 (input/output)/ hifcs (input) pc22 (input/output)/hifrs (input) pc21 (input/output)/ hifwr (input) pc00 (input/output)/hifd00 (input/output) pc01 (input/output)/hifd01 (input/output) pc02 (input/output)/hifd02 (input/output) pc03 (input/output)/hifd03 (input/output) port g figure 24.7 port g
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1059 of 1262 rej09b0437-0100 24.7.1 register descriptions port g is a 24-bit i/o port. port g has the follo wing registers. refer to section 28, list of registers, for more details on the addresses and states of these register s in each operating mode. port g data register h (pgdrh) port g data register l (pgdrl) 24.7.2 port g data registers h and l (pgdrh and pgdrl) pgdrh and pgdrl are 16-bit read able/writable registers that store port g data. bits pg23dr to pg0dr correspond to pins pg23 to pg00, respectively (description of the other functions are omitted). if a pin is set to the general output function, the pin will output the value written to the corresponding bit in pgdrh or pgdrl, and the register value is read from pgdrh or pgdrl regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if pgdrh or pgdrl is read. also, if a value is wr itten to pgdrh or pgdrl, although the value will actually be written, it will have no influence on the state of the pin.table 24.7 summarizes the pgdrh and pgdrl read/write operations.
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1060 of 1262 rej09b0437-0100 ? pgdrh 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrr/wr/wr/wr/wr/wr/wr/wr/w -- --- - pg23 dr pg22 dr pg21 dr pg20 dr pg19 dr pg18 dr pg17 dr pg16 dr -- bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 pg23dr 0 r/w see table 24.7. 6 pg22dr 0 r/w 5 pg21dr 0 r/w 4 pg20dr 0 r/w 3 pg19dr 0 r/w 2 pg18dr 0 r/w 1 pg17dr 0 r/w 0 pg16dr 0 r/w
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1061 of 1262 rej09b0437-0100 ? pgdrl 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pg8 dr pg15 dr pg14 dr pg13 dr pg12 dr pg11 dr pg10 dr pg9 dr pg2 dr pg1 dr pg0 dr pg7 dr pg6 dr pg5 dr pg4 dr pg3 dr bit bit name initial value r/w description 15 pg15dr 0 r/w see table 24.7. 14 pg14dr 0 r/w 13 pg13dr 0 r/w 12 pg12dr 0 r/w 11 pg11dr 0 r/w 10 pg10dr 0 r/w 9 pg9dr 0 r/w 8 pg8dr 0 r/w 7 pg7dr 0 r/w 6 pg6dr 0 r/w 5 pg5dr 0 r/w 4 pg4dr 0 r/w 3 pg3dr 0 r/w 2 pg2dr 0 r/w 1 pg1dr 0 r/w 0 pg0dr 0 r/w
section 24 i/o ports rev. 1.00 nov. 14, 2007 page 1062 of 1262 rej09b0437-0100 table 24.7 port g data regist ers l (pgdrl) read/write operations bits 7 to 0 of pgdrh and bits 15 to 0 of pgdrl pin function pgiorl read write general input 0 pin state the value is written to pgdrh or pgdrl but there is no effect on the pin state. general output 1 value of pgdrh or pgdrl the value written is output from the pin. other functions * value of pgdrh or pgdrl the value is written to pgdrh or pgdrl but there is no effect on the pin state.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1063 of 1262 rej09b0437-0100 section 25 user break controller (ubc) the user break controller (ubc) provides functions that simplify program debugging. these functions make it easy to design an effective self-monitoring debugger, enabling the chip to debug programs without using an in-circuit emulator. instruction fetch or data read/write (bus master (cpu or dmac) selection in the case of data read/w rite), data size, data contents, address value, and stop timing in the case of instruction fetch are break conditions that can be set in the ubc. since this lsi uses a harvard arch itecture, instruction fetch on the cpu bus (c bus) is performed by issuing bus cycles on the in struction fetch bus (f bus), an d data access on the c bus is performed by issuing bus cycles on the memory access bus (m bus). the ubc monitors the c bus and internal bus (i bus). 25.1 features 1. the following break comparison conditions can be set. number of break channels: two channels (channels 0 and 1) user break can be requested as the independent condition on channels 0 and 1. ? address comparison of the 32-bit address is maskable in 1-bit units. one of the three address buses (f address bus (fab), m address bus (mab), and i address bus (iab)) can be selected. ? data comparison of the 32-bit data is maskable in 1-bit units. one of the two data buses (m data bus (mdb) and i data bus (idb)) can be selected. ? bus master when i bus is selected selection of cpu cycles, dmac cycles, a-dmac (including f-dmac) cycles, or e-dmac cycles ? bus cycle instruction fetch (only when c bu s is selected) or data access ? read/write ? operand size byte, word, and longword 2. in an instruction fe tch cycle, it can be selected whethe r the start of user break interrupt exception processing is set before or after an instruction is executed.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1064 of 1262 rej09b0437-0100 figure 25.1 shows a block diagram of the ubc. idb iab mab fab mdb bbr_0 bbr_1 bar_0 bamr_0 bdr_0 bdmr_0 bar_1 bamr_1 bdr_1 bdmr_1 brcr i bus access comparator address comparator channel 0 access comparator address comparator data comparator control channel 1 user break interrupt request [legend] bbr: bar: bamr: bdr: bdmr: brcr: break bus cycle register break address register break address mask register access control data comparator ubctrg pin output i bus c bus break data register break data mask registe break control register figure 25.1 block diagram of ubc
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1065 of 1262 rej09b0437-0100 25.2 register descriptions the ubc has the following regist ers. five control registers fo r each channel and one common control register for channel 0 and channel 1 are available. a register for each channel is described as bar_0 for the bar register in channel 0. table 25.1 register configuration channel register name abbrevia- tion r/w initial value address access size break address register_0 bar_0 r/w h'00000000 h'fffc0400 32 break address mask register_0 bamr_0 r/w h'00000000 h'fffc0404 32 break bus cycle register_0 bbr_0 r/w h'0000 h'fffc04a0 16 break data register_0 bdr_0 r/w h'00000000 h'fffc0408 32 0 break data mask register_0 bdmr_0 r/w h'00000000 h'fffc040c 32 break address register_1 bar_1 r/w h'00000000 h'fffc0410 32 break address mask register_1 bamr_1 r/w h'00000000 h'fffc0414 32 break bus cycle register_1 bbr_1 r/w h'0000 h'fffc04b0 16 break data register_1 bdr_1 r/w h'00000000 h'fffc0418 32 1 break data mask register_1 bdmr_1 r/w h'00000000 h'fffc041c 32 common break control register brcr r/w h'00000000 h'fffc04c0 32
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1066 of 1262 rej09b0437-0100 25.2.1 break addres s register (bar) bar is a 32-bit readable/writable register. bar specifies the addres s used as a break condition in each channel. the control bits cd[1:0] in the br eak bus cycle register (b br) select one of the three address buses for a break condition. bar is initialized to h'00000000 by a power-on reset, but retains its previous value by a manual reset or in software standby mode or sleep mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: ba31 ba30 ba29 ba28 ba27 ba26 ba25 ba24 ba23 ba22 ba21 ba20 ba19 ba18 ba17 ba16 ba15 ba14 ba13 ba12 ba11 ba10 ba9 ba8 ba7 ba6 ba5 ba4 ba3 ba2 ba1 ba0 bit bit name initial value r/w description 31 to 0 ba31 to ba0 all 0 r/w break address store an address on the cpu address bus (fab or mab) or iab specifying break conditions. when the c bus and instruction fetch cycle are selected by bbr, specify an fab address in bits ba31 to ba0. when the c bus and data access cycle are selected by bbr, specify an mab address in bits ba31 to ba0. note: when setting the instruction fetch cycle as a break condition, clear the lsb in bar to 0.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1067 of 1262 rej09b0437-0100 25.2.2 break address mask register (bamr) bamr is a 32-bit readable/writable register. ba mr specifies bits masked in the break address bits specified by bar. bamr is initialized to h'00000000 by a power-on reset, but retains its previous value by a manual reset or in software standby mode or sleep mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: bam31 bam30 bam29 bam28 bam27 bam26 bam25 bam24 bam23 bam22 bam21 bam20 bam19 bam18 bam17 bam16 bam15 bam14 bam13 bam12 bam11 bam10 bam9 bam8 bam7 bam6 bam5 bam4 bam3 bam2 bam1 bam0 bit bit name initial value r/w description 31 to 0 bam31 to bam0 all 0 r/w break address mask specify bits masked in the break address bits specified by bar (ba31 to ba0). 0: break address bit ban is included in the break condition 1: break address bit ban is masked and not included in the break condition note: n = 31 to 0
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1068 of 1262 rej09b0437-0100 25.2.3 break data register (bdr) bdr is a 32-bit readable/writable register. the control bits cd[1:0]in the break bus cycle register (bbr) select one of the two data buses for a break condition. bdr is initialized to h'00000000 by a power-on reset, but retains its previous value by a manual reset or in software standby mode or sleep mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: bd31 bd30 bd29 bd28 bd27 bd26 bd25 bd24 bd23 bd22 bd21 bd20 bd19 bd18 bd17 bd16 bd15 bd14 bd13 bd12 bd11 bd10 bd9 bd8 bd7 bd6 bd5 bd4 bd3 bd2 bd1 bd0 bit bit name initial value r/w description 31 to 0 bd31 to bd0 all 0 r/w break data bits store data which specifies a break condition. if the i bus is selected in bbr, specify the break data on idb in bits bd31 to bd0. if the c bus is selected in bbr, specify the break data on mdb is set in bits bd31 to bd0. notes: 1. set the operand size when specifying a value on a data bus as the break condition. 2. when the byte size is selected as a break condition, the same byte data must be set in bits 31 to 24, 23 to 16, 15 to 8, and 7 to 0 in bdr as the break data. similarly, when the word size is selected, the sa me word data must be set in bits 31 to 16 and 15 to 0.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1069 of 1262 rej09b0437-0100 25.2.4 break data mask register (bdmr) bdmr is a 32-bit readable/writable register. bdmr specifies bits masked in the break data bits specified by bdr. bdmr is initialized to h'00000000 by a power-on reset, but retains its previous value by a manual reset or in software standby mode or sleep mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: bdm31 bdm30 bdm29 bdm28 bdm27 bdm26 bdm25 bdm24 bdm23 bdm22 bdm21 bdm20 bdm19 bdm18 bdm17 bdm16 bdm15 bdm14 bdm13 bdm12 bdm11 bdm10 bdm9 bdm8 bdm7 bdm6 bdm5 bdm4 bdm3 bdm2 bdm1 bdm0 bit bit name initial value r/w description 31 to 0 bdm31 to bdm0 all 0 r/w break data mask specify bits masked in the break data bits specified by bdr (bd31 to bd0). 0: break data bit bdn is included in the break condition 1: break data bit bdn is masked and not included in the break condition note: n = 31 to 0 notes: 1. set the operand size when specifying a value on a data bus as the break condition. 2. when the byte size is selected as a break condition, the same byte data must be set in bits 31 to 24, 23 to 16, 15 to 8, and 7 to 0 in bdmr as the break mask data. similarly, when the word size is selected, the same wo rd data must be set in bits 31 to 16 and 15 to 0.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1070 of 1262 rej09b0437-0100 25.2.5 break bus cy cle register (bbr) bbr is a 16-bit readable/writable register, which sp ecifies (1) disabling or enabling of user break interrupt requests, (2) including or excluding of the data bus value, (3) bus master of the i bus, (4) c bus cycle or i bus cycle, (5) in struction fetch or data access, (6) read or write, and (7) operand size as the break conditions. bbr is initialized to h'0000 by a power-on reset, but retains its previous value by a manual reset or in software standby mode or sleep mode. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ?? ubid dbe cp[3:0] cd[1:0] id[1:0] rw[1:0] sz[1:0] bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13 ubid 0 r/w user break interrupt disable disables or enables user break interrupt requests when a break condition is satisfied. 0: user break interrupt requests enabled 1: user break interrupt requests disabled 12 dbe 0 r/w data break enable selects whether the data bus condition is included in the break conditions. 0: data bus condition is not included in break conditions 1: data bus condition is included in break conditions 11 to 8 cp[3:0] 00 r/w i-bus bus master select select the bus master when the bus cycle of the break condition is the i bus cycle. however, when the c bus cycle is selected, this bit is invalidated (only the cpu cycle). xxx1: cpu cycle is included in break conditions. xx1x: dmac cycle is included in break conditions. x1xx: a-dmac (including f-dmac) cycle is included in break conditions. 1xxx: e-dmac cycle is includ ed in break conditions.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1071 of 1262 rej09b0437-0100 bit bit name initial value r/w description 7, 6 cd[1:0] 00 r/w c bus cycle/i bus cycle select select the c bus cycle or i bus cycle as the bus cycle of the break condition. 00: condition comparison is not performed 01: break condition is the c bus (f bus or m bus) cycle 10: break condition is the i bus cycle 11: break condition is the c bus (f bus or m bus) cycle 5, 4 id[1:0] 00 r/w instructi on fetch/data access select select the instruction fetch cycle or data access cycle as the bus cycle of the break condition. if the instruction fetch cycle is se lected, select the c bus cycle. 00: condition comparison is not performed 01: break condition is the instruction fetch cycle 10: break condition is the data access cycle 11: break condition is the instruction fetch cycle or data access cycle 3, 2 rw[1:0] 00 r/w read/write select select the read cycle or write cycle as the bus cycle of the break condition. 00: condition comparison is not performed 01: break condition is the read cycle 10: break condition is the write cycle 11: break condition is the read cycle or write cycle 1, 0 sz[1:0] 00 r/w operand size select select the operand size of the bus cycle for the break condition. 00: break condition does not include operand size 01: break condition is byte access 10: break condition is word access 11: break condition is longword access [legend] x: don't care
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1072 of 1262 rej09b0437-0100 25.2.6 break control register (brcr) brcr sets the following conditions: 1. specifies whether a start of us er break interrupt exception processing by instruction fetch cycle is set before or after instruction execution. brcr is a 32-bit readable/writable register that has break condition match flags and bits for setting other break conditions. for the condition match flags of bits 15 to 12, writing 1 is invalid (previous values are retained) and writing 0 is only possible. to clear the flag, write 0 to the flag bit to be cleared and 1 to all other flag bits. brcr is initialized to h'00000000 by a power-on reset, but retains its previous value by a manual reset or in software standby mode or sleep mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r/w r/w r/w r/w r r r r r r/w r/w r r r r r ?????????????? scmfc 0 scmfc 1 scmfd 0 scmfd 1 ????? pcb1 pcb0 ????? ?? bit bit name initial value r/w description 31 to 16 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 15 scmfc0 0 r/w c bus cycle condition match flag 0 when the c bus cycle conditio n in the break conditions set for channel 0 is satisfied, this flag is set to 1. in order to clear this flag, write 0 to this bit. 0: the c bus cycle conditio n for channel 0 does not match 1: the c bus cycle conditio n for channel 0 matches
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1073 of 1262 rej09b0437-0100 bit bit name initial value r/w description 14 scmfc1 0 r/w c bus cycle condition match flag 1 when the c bus cycle conditio n in the break conditions set for channel 1 is satisfied, this flag is set to 1. in order to clear this flag, write 0 to this bit. 0: the c bus cycle conditio n for channel 1 does not match 1: the c bus cycle conditio n for channel 1 matches 13 scmfd0 0 r/w i bus cycle condition match flag 0 when the i bus cycle condition in the break conditions set for channel 0 is satisfied, this flag is set to 1. in order to clear this flag, write 0 to this bit. 0: the i bus cycle condition for channel 0 does not match 1: the i bus cycle condition for channel 0 matches 12 scmfd1 0 r/w i bus cycle condition match flag 1 when the i bus cycle condition in the break conditions set for channel 1 is satisfied, this flag is set to 1. in order to clear this flag, write 0 to this bit. 0: the i bus cycle condition for channel 1 does not match 1: the i bus cycle condition for channel 1 matches 11 to 7 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 6 pcb1 0 r/w pc break select 1 selects the break timing of the instruction fetch cycle for channel 1 as before or after instruction execution. 0: pc break of channel 1 is generated before instruction execution 1: pc break of channel 1 is generated after instruction execution 5 pcb0 0 r/w pc break select 0 selects the break timing of the instruction fetch cycle for channel 0 as before or after instruction execution. 0: pc break of channel 0 is generated before instruction execution 1: pc break of channel 0 is generated after instruction execution 4 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1074 of 1262 rej09b0437-0100 25.3 operation 25.3.1 flow of the user break operation the flow from setting of break conditions to user break interrupt exception handling is described below: 1. the break address is set in a break address regi ster (bar). the masked ad dress bits are set in a break address mask register (bamr). the break data is set in the break data register (bdr). the masked data bits are set in the break data mask register (bdmr). the bus break conditions are set in the break bus cycle regist er (bbr). three control bit groups of bbr (c bus cycle/i bus cycle select, instruction fetch/da ta access select, and read/write select) are each set. no user break will be generated if even one of these groups is set to 00. the relevant break control conditions are set in the bits of the break control register (brcr). make sure to set all registers related to breaks before setting bbr, and branch after reading from the last written register. the newly written register values beco me valid from the instruction at the branch destination. 2. in the case where the break co nditions are satisfied and the user break interrupt request is enabled, the ubc sends a user break interrupt request to the intc, sets the c bus condition match flag (scmfc) or i bus condition match flag (scmfd) for the appropriate channel. 3. on receiving a user break inte rrupt request signal, the intc de termines its priority. since the user break interrupt has a priority level of 15, it is accepted when the priority level set in the interrupt mask level bits (i3 to i0) of the status re gister (sr) is 14 or lower. if the i3 to i0 bits are set to a priority level of 15, the user brea k interrupt is not accepted, but the conditions are checked, and condition match flags are set if the conditions match. for details on ascertaining the priority, see section 6, interrupt controller (intc). 4. condition match flags (scmfc and scmfd) can be used to check which condition has been satisfied. clear the condition match flags during the user break interrupt exception processing routine. the interrupt occurs again if this operation is not performed. 5. there is a chance that the break set in chan nel 0 and the break set in channel 1 occur around the same time. in this case, there will be only one user break request to the intc, but these two break channel match flags may both be set. 6. when selecting the i bus as the break condition, note as follows: ? several bus masters, including the cpu, dmac, a-dmac (including f-dmac), and e- dmac, are connected to the i bus. the ubc mo nitors bus cycles generated by the bus master specified by bbr, and determines the condition match.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1075 of 1262 rej09b0437-0100 ? whether or not an access issued on the c bus by the cpu is issued on the i bus depends on the cache settings. regarding the i bus operati on under cache conditions, see table 4.8 in section 4, cache. ? when a break condition is speci fied for the i bus, only the da ta access cycle is monitored. the instruction fetch cycle (including the cache renewal cycle) is not monitored. ? the dmac only issues data access cycles for i bus cycles. ? if a break condition is specified for the i bus, even when the condition matches in an i bus cycle resulting from an instruction executed by the cpu, at which instruction the user break interrupt request is to be accepted cannot be clearly defined. 25.3.2 break on inst ruction fetch cycle 1. when c bus/instruction fetch/read/word or longword is set in the break bus cycle register (bbr), the break condition is the fab bus instru ction fetch cycle. whether a start of user break interrupt exception processing is set befo re or after the execution of the instruction can then be selected with the pcb0 or pcb1 bit of the break control register (brcr) for the appropriate channel. if an inst ruction fetch cycle is set as a break condition, clear ba0 bit in the break address register (bar) to 0. a break cannot be generated as long as this bit is set to 1. 2. a break for instruction fetch which is set as a break before instruction execution occurs when it is confirmed that the instruction has been fe tched and will be executed. this means a break does not occur for instructions fetched by overrun (instructions fetched at a branch or during an interrupt transition, but not to be executed). wh en this kind of break is set for the delay slot of a delayed branch instruction, the user break interrupt request is not received until the execution of the first instruction at the branch destination. note: if a branch does not occur at a delayed bran ch instruction, the subsequent instruction is not recognized as a delay slot. 3. when setting a break condition for break after instruction execution, the instruction set with the break condition is executed and then the break is generated prior to execution of the next instruction. as with pre-execution breaks, a break does not occu r with overrun fetch instructions. when this kind of break is set for a delayed branch instruction and its delay slot, the user break interrup t request is not received until the first instruction at the branch destination. 4. when an instruction fetch cycle is set, the br eak data register (bdr) is ignored. therefore, break data cannot be set for the break of the instruction fetch cycle. 5. if the i bus is set for a break of an instru ction fetch cycle, the setting is invalidated.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1076 of 1262 rej09b0437-0100 25.3.3 break on data access cycle 1. if the c bus is specified as a break conditi on for data access break, condition comparison is performed for the addresses (and data) accessed by the executed instructions, and a break occurs if the condition is satisfied. if the i bus is specified as a break condition, condition comparison is performed for the addresses (and data) of the data access cycles that are issued by the bus master specified by th e bits to select the bus master of the i bus, and a break occurs if the condition is satisfied. for details on the cpu bus cycles issued on the i bus, see 6 in section 25.3.1, flow of th e user break operation. 2. the relationship between the data access cycle address and the comparis on condition for each operand size is listed in table 25.2. table 25.2 data access cycle addresses and operand size comparison conditions access size address compared longword compares break address register bits 31 to 2 to address bus bits 31 to 2 word compares break address register bits 31 to 1 to address bus bits 31 to 1 byte compares break address register bits 31 to 0 to address bus bits 31 to 0 this means that when address h'00001003 is set in the break address register (bar), for example, the bus cycle in which the break condition is satisfied is as follows (where other conditions are met). longword access at h'00001000 word access at h'00001002 byte access at h'00001003 3. when the data value is included in the break conditions: when the data value is included in the break conditions, either longword, word, or byte is specified as the operand size in the break bus cycle register (bbr). when data values are included in break conditions, a break is generated when the address conditions and data conditions both match. to specify byte data for this case, set the same data in the four bytes at bits 31 to 24, 23 to 16, 15 to 8, and 7 to 0 of the break data register (bdr) and break data mask register (bdmr). to specify word data for this cas e, set the same data in the two words at bits 31 to 16 and 15 to 0. 4. access by a pref instruction is handled as read access in long word units without access data. therefore, if including the value of the data bus when a pref instruction is specified as a break condition, a break will not occur. 5. if the data access cycle is selected, the instru ction at which the break will occur cannot be determined.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1077 of 1262 rej09b0437-0100 25.3.4 value of saved program counter when a user break interrupt request is receive d, the address of the instruction from where execution is to be resumed is saved to the stack, and the exception handling state is entered. if the c bus (fab)/instruction fetch cycl e is specified as a break conditi on, the instruction at which the break should occur can be uniquely determined. if the c bus/data access cycle or i bus/data access cycle is specified as a break condition, the instru ction at which the break should occur cannot be uniquely determined. 1. when c bus (fab)/instruction fetch (before in struction execution) is specified as a break condition: the address of the instruction that matched the break condition is saved to the stack. the instruction that matched the condition is not executed, and the break occurs before it. however when a delay slot instruction matches the condition, the instruction is executed, and the branch destination address is saved to the stack. 2. when c bus (fab)/instruction fetch (after in struction execution) is specified as a break condition: the address of the instruction following the instruction that matched the break condition is saved to the stack. the instruction that matches the condition is executed , and the break occurs before the next instruction is executed. however when a delayed branch instruction or delay slot matches the condition, the instruction is executed, and the branch destination address is saved to the stack. 3. when c bus/data access cycle or i bus/data access cycle is specified as a break condition: the address after executing several instructions of the instruction that matched the break condition is saved to the stack.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1078 of 1262 rej09b0437-0100 25.3.5 usage examples (1) break condition specified for c bus instruction fetch cycle (example 1-1) ? register specifications bar_0 = h'00000404, bamr_0 = h'00000000, bbr_0 = h'0054, bar_1 = h'00008010, bamr_1 = h'00000006, bbr_1 = h'0054, bdr_1 = h'00000000, bdmr_1 = h'00000000, brcr = h'00000020 address: h'00000404, address mask: h'00000000 bus cycle: c bus/instruction fetch (after inst ruction execution)/read (operand size is not included in the condition) address: h'00008010, address mask: h'00000006 data: h'00000000, data mask: h'00000000 bus cycle: c bus/instruction fetch (before in struction execution)/read (operand size is not included in the condition) a user break occurs after an instruction of address h'00000404 is executed or before instructions of addresses h'00008010 to h'00008016 are executed. (example 1-2) ? register specifications bar_0 = h'00027128, bamr_0 = h'00000000, bbr_0 = h'005a, bar_1= h'00031415, bamr_1 = h'00000000, bbr_1 = h'0054, bdr_1 = h'00000000, bdmr_1 = h'00000000, brcr = h'00000000 address: h'00027128, address mask: h'00000000 bus cycle: c bus/instruction fetch (b efore instruction execution)/write/word address: h'00031415, address mask: h'00000000 data: h'00000000, data mask: h'00000000 bus cycle: c bus/instruction fetch (before in struction execution)/read (operand size is not included in the condition) on channel 0, a user break does not occur sin ce instruction fetch is not a write cycle. on channel 1, a user break does not occur since instruction fetch is performed for an even address.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1079 of 1262 rej09b0437-0100 (example 1-3) ? register specifications bar_0 = h'00008404, bamr_0 = h'00000fff, bbr_0 = h'0054, bar_1= h'00008010, bamr_1 = h'00000006, bbr_1 = h'0054, bdr_1 = h'00000000, bdmr_1 = h'00000000, brcr = h'00000020 address: h'00008404, address mask: h'00000fff bus cycle: c bus/instruction fetch (after inst ruction execution)/read (operand size is not included in the condition) address: h'00008010, address mask: h'00000006 data: h'00000000, data mask: h'00000000 bus cycle: c bus/instruction fetch (before in struction execution)/read (operand size is not included in the condition) a user break occurs after an in struction with addresses h'00008000 to h'00008ffe is executed or before an instruction with addresses h'00008010 to h'00008016 are executed. (2) break condition specified fo r c bus data access cycle (example 2-1) ? register specifications bar_0 = h'00123456, bamr_0 = h'00000000, bbr_0 = h'0064, bar_1= h'000abcde, bamr_1 = h'000000ff, bbr_1 = h'106a, bdr_1 = h'a512a512, bdmr_1 = h'00000000, brcr = h'00000000 address: h'00123456, address mask: h'00000000 bus cycle: c bus/data access/read (operand size is not included in the condition) address: h'000abcde, address mask: h'000000ff data: h'0000a512, data mask: h'00000000 bus cycle: c bus/data access/write/word on channel 0, a user break occurs with longword read from address h'00123456, word read from address h'00123456, or byte read from address h'00123456. on channel 1, a user break occurs when word h'a512 is written in addresses h'000abc00 to h'000abcfe.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1080 of 1262 rej09b0437-0100 (3) break condition specified fo r i bus data access cycle (example 3-1) ? register specifications bar_0 = h'00314156, bamr_0 = h'00000000, bbr_0 = h'0094, bar_1= h'00055555, bamr_1 = h'00000000, bbr_1 = h'12a9, bdr_1 = h'78787878, bdmr_1 = h'0f0f0f0f, brcr = h'00000000 address: h'00314156, address mask: h'00000000 bus cycle: i bus/instruction fetch/read (operand size is not included in the condition) address: h'00055555, address mask: h'00000000 data: h'00000078, data mask: h'0000000f bus cycle: i bus/data access/write/byte on channel 0, the setting of i bus/instruction fetch is ignored. on channel 1, a user break occurs when the dmac writes byte data h'7x in address h'00055555 on the i bus (write by the cpu does not generate a user break).
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1081 of 1262 rej09b0437-0100 25.4 usage notes 1. the cpu can read from or write to the ubc re gisters via the i bus. accordingly, during the period from executing an instruction to rewrite the ubc register till the new value is actually rewritten, the desired break may not occur. in or der to know the timing when the ubc register is changed, read from the last written register. instructions after then are valid for the newly written register value. 2. the ubc cannot monitor access to the c bus and i bus cycles in the same channel. 3. when a user break interrupt request and another exception source occur at the same instruction, which has higher priority is determined according to the priority levels defined in table 5.1 in section 5, exception handling. if an exception source with higher priority occurs, the user break interrupt request is not received. 4. note the following when a break occurs in a delay slot. if a pre-execution break is set at a delay slot instruction, the user break interrupt request is not received immediately before executio n of the branch destination. 5. user breaks are disabled during ubc module standby mode. do not read from or write to the ubc registers during ubc module standby mode; the values are not guaranteed. 6. do not set an address within an interrupt exception handling routine whose interrupt priority level is at least 15 (including user break interrupts) as a break address. 7. do not set break after instruction executio n for the sleep instruct ion or for the delayed branch instruction where the sleep inst ruction is placed at its delay slot. 8. when setting a break for a 32-bit instruction, set the address where the upper 16 bits are placed. if the address of the lower 16 bits is set and a break before instruction execution is set as a break condition, the break is handled as a break after inst ruction execution. 9. do not set a user break before instruction execution for the instruction following the divu or divs instruction. if a user break before inst ruction execution is set for the instruction following the divu or divs instruction and an exception or interrupt occurs during execution of the divu or divs instruction, a user brea k occurs before instruct ion execution even though execution of the divu or divs instruction is halted. 10. do not set a user break both before instruction execution and after instruction execution for instruction of the same address. if, for example, a us er break before instruction execution on channel 0 and a user break after instruction on ch annel 1 are set at the instruction of the same address, the condition ma tch flag for the channel 1 is set even though a user break on channel 0 occurs before inst ruction ex ecution.
section 25 user break controller (ubc) rev. 1.00 nov. 14, 2007 page 1082 of 1262 rej09b0437-0100
section 26 high-performance us er debugging interface (h-udi) rev. 1.00 nov. 14, 2007 page 1083 of 1262 rej09b0437-0100 section 26 high-performance user debugging interface (h-udi) this lsi incorporates a high-perf ormance user debugging interface (h-udi) for emul ator support. 26.1 features the high-performance user debugging interface (h-udi) has reset and interrupt request functions. the h-udi in this lsi is used for emulator co nnection. refer to the emulator manual for the method of connecting the emulator. figure 26.1 shows a block diagram of the h-udi. sdbpr: sdir: sdir tck tdo tdi tms trst sdbpr mux shift register tap control circuit decoder local bus [legend] bypass register instruction register figure 26.1 block diagram of h-udi
section 26 high-performance us er debugging interface (h-udi) rev. 1.00 nov. 14, 2007 page 1084 of 1262 rej09b0437-0100 26.2 input/output pins table 26.1 pin configuration pin name symbol i/o function h-udi serial data input/output clock pin tck input data is serially supplied to the h-udi from the data input pin (t di), and output from the data output pin (tdo), in synchronization with this clock. mode select input pin tms input the st ate of the tap control circuit is determined by changing this signal in synchronization with tck. for the protocol, see figure 26.2. h-udi reset input pin trst input input is accepted asynchronously with respect to tck, and when low, the h-udi is reset. trst must be low for a constant period when power is turned on regardless of using the h-udi f unction. see section 26.4.2, reset configuration, for more information. h-udi serial data input pin tdi input data transfer to the h-udi is executed by changing this signal in synchronization with tck. h-udi serial data output pin tdo output da ta read from the h-udi is executed by reading this pin in synchronization with tck. the initial val ue of the data output timing is the tck falling edge. this can be changed to the tck rising edge by inputting the tdo change timing switch command to sdir. see section 26.4.3, tdo output timing, fo r more information. ase mode select pin asemd * input if a low level is input at the asemd pin while the res pin is asserted, ase mode is entered; if a high level is input, normal mode is entered. in ase mode, dedicated emulator function can be used. the input level at the asemd pin should be held for at least one cycle after res negation. note: * when the emulator is not in use, fix this pin to the high level.
section 26 high-performance us er debugging interface (h-udi) rev. 1.00 nov. 14, 2007 page 1085 of 1262 rej09b0437-0100 26.3 register descriptions the h-udi has the following registers. table 26.2 register configuration register name abbreviation r/w initial value address access size bypass register sdbpr ? ? ? ? instruction register sdir r h'effd h'fffe2000 16 26.3.1 bypass register (sdbpr) sdbpr is a 1-bit register that cannot be accesse d by the cpu. when sd ir is set to bypass mode, sdbpr is connected between h-udi pins tdi and tdo. the initial value is undefined.
section 26 high-performance us er debugging interface (h-udi) rev. 1.00 nov. 14, 2007 page 1086 of 1262 rej09b0437-0100 26.3.2 instruction register (sdir) sdir is a 16-bit read-only register. it is initialized by trst assertion or in the tap test-logic- reset state, and can be written to by the h-udi irrespective of the cpu mode. operation is not guaranteed if a reserved command is set in this register. the initial value is h'effd. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 note: the initial value of the ti[7:0] bits is a reserved value. when setting a command, the ti[7:0] bits must be set to another value. * 1 * 1 * 1 * 0 * 1 * 1 * 1 * 1 * 11111101 rrrrrrrrrrrrrrrr bit: initial value: r/w: ti[7:0] - - - - - - - - bit bit name initial value r/w description 15 to 8 ti[7:0] 11101111 * r test instruction the h-udi instruction is transferred to sdir by a serial input from tdi. for commands, see table 26.3. 7 to 2 ? all 1 r reserved these bits are always read as 1. 1 ? 0 r reserved this bit is always read as 0. 0 ? 1 r reserved this bit is always read as 1. table 26.3 h-udi commands bits 15 to 8 ti7 ti6 ti5 ti4 ti3 ti 2 ti1 ti0 description 0 1 1 0 ? ? ? ? h-udi reset negate 0 1 1 1 ? ? ? ? h-udi reset assert 1 0 0 1 1 1 0 0 tdo change timing switch 1 0 1 1 ? ? ? ? h-udi interrupt 1 1 1 1 ? ? ? ? bypass mode other than above reserved
section 26 high-performance us er debugging interface (h-udi) rev. 1.00 nov. 14, 2007 page 1087 of 1262 rej09b0437-0100 26.4 operation 26.4.1 tap controller figure 26.2 shows the internal states of the tap controller. test -logic-reset capture-dr shift-dr exit1-dr pause-dr exit2-dr update-dr select-dr run-test/idle 1 0 0 0 0 11 1 1 0 0 0 1 11 0 1 1 1 0 capture-ir shift-ir exit1-ir pause-ir exit2-ir update-ir select-ir 0 0 1 0 0 0 1 0 1 1 10 figure 26.2 tap controller state transitions note: the transition condition is the tms value at the rising edge of tck. the tdi value is sampled at the rising edge of tck; shifting occurs at the falling edge of tck. for details on change timing of the tdo value, see sect ion 26.4.3, tdo output timing. the tdo is at high impedance, except with shift-dr and shift-ir states. during the change to trst = 0, there is a transition to test-logic-reset asynchronously with tck.
section 26 high-performance us er debugging interface (h-udi) rev. 1.00 nov. 14, 2007 page 1088 of 1262 rej09b0437-0100 26.4.2 reset configuration table 26.4 reset configuration asemd * 1 res trst chip state h l l power-on reset and h-udi reset h power-on reset h l h-udi reset only h normal operation l l l reset hold * 2 h power-on reset h l h-udi reset only h normal operation notes: 1. performs normal mode and ase mode settings asemd = h, normal mode asemd = l, ase mode 2. in ase mode, reset hold is entered if the trst pin is driven low while the res pin is negated. in this state, t he cpu does not start up. when trst is driven high, h-udi operation is enabled, but the cpu does not st art up. the reset hold state is cancelled by a power-on reset.
section 26 high-performance us er debugging interface (h-udi) rev. 1.00 nov. 14, 2007 page 1089 of 1262 rej09b0437-0100 26.4.3 tdo output timing the initial value of the tdo change timing is to perform data output from the tdo pin on the tck falling edge. however, setting a tdo change timing switch command in sdir via the h- udi pin and passing the update-ir state synchroni zes the tdo change timi ng to the tck rising edge. hereafter, to synchronize the change timing of td0 to the falling edge of tck, the trst pin must be simultaneously asserted with the power-on reset. in a case of power-on reset by the res pin, the sync reset is still in operation for a certain period in the lsi even after the res pin is negated. thus, if the trst pin is asserted immediately after the negate of the res pin, the td0 change timing switch command is cleared, resulting the td0 change timing synchronized with the falling edge of tck. to prevent this, make sure to put a period of 20 times of tcyc or longer between the signal change timing of the res and trst pins. tdo (initial value) tck tdo (after execution of tdo change timing switch command) t tdod t tdod figure 26.3 h-udi data transfer timing
section 26 high-performance us er debugging interface (h-udi) rev. 1.00 nov. 14, 2007 page 1090 of 1262 rej09b0437-0100 26.4.4 h-udi reset an h-udi reset is executed by setting an h-udi reset assert command in sdir. an h-udi reset is of the same kind as a power-on reset. an h- udi reset is released by setting an h-udi reset negate command. the required time between th e h-udi reset assert command and h-udi reset negate command is the same as time for keeping the res pin low to apply a power-on reset. h-udi reset assert h-udi reset negate sdir chip internal reset cpu state fetch the initial values of pc and sr from the exception handling vector table figure 26.4 h-udi reset 26.4.5 h-udi interrupt the h-udi interrupt function generates an interrupt by setting a command from the h-udi in sdir. an h-udi interrupt is a general exception/interrupt operation, resulting in fetching the exception service routine start ad dress from the exception handling vector table, jumping to that address, and starting program execution from that address. this interrupt request has a fixed priority level of 15. h-udi interrupts are accepted in sleep mo de, but not in software standby mode.
section 26 high-performance us er debugging interface (h-udi) rev. 1.00 nov. 14, 2007 page 1091 of 1262 rej09b0437-0100 26.5 usage notes 1. an h-udi command, once set, will not be modified as long as another command is not set again from the h-udi. if the same command is to be set continuously, the command must be set after a command (byp ass mode, etc.) that do es not affect chip operations is once set. 2. in software standby mode and h-udi module standby state, all of the functions in the h-udi cannot be used. to retain the tap status before and after standby mode, keep tck high before entering standby mode. 3. regardless of whether the h-udi is used, make sure to keep the trst pin low at power-on to initialize the h-udi. 4. make sure to put 20 t cyc or more between the signal change timing of the res and trst pins. 5. when starting the tap controller after the negation of the trst pin, make sure to allow 200 ns or more after the negation.
section 26 high-performance us er debugging interface (h-udi) rev. 1.00 nov. 14, 2007 page 1092 of 1262 rej09b0437-0100
section 27 on-chip ram rev. 1.00 nov. 14, 2007 page 1093 of 1262 rej09b0437-0100 section 27 on-chip ram this lsi has an on-chip ram module which can be used to store instructions or data. on-chip ram operation and write access to the ra m can be enabled or disabled through the ram enable bits and ram write enable bits. 27.1 features ? pages the on-chip ram is divided into four pages (pages 0 to 3). ? memory map the on-chip ram is located in the address spaces shown in table 27.1. table 27.1 on-chip ram address spaces 32 kbytes page address page 0 h'fff80000 to h'fff81fff page 1 h'fff82000 to h'fff83fff page 2 h'fff84000 to h'fff85fff page 3 h'fff86000 to h'fff87fff ? ports each page has two independent read and write ports and is connected to the internal bus (i bus), cpu instruction fetch bus (f bus), and cp u memory access bus (m bu s). (note that the f bus is connected only to the read ports.) the f bus and m bus are used for access by the cpu, and the i bus is used for access by the dmac. ? priority when the same page is accessed from different buses simultan eously, the access is processed according to the priority. the priority is i bus > m bus > f bus.
section 27 on-chip ram rev. 1.00 nov. 14, 2007 page 1094 of 1262 rej09b0437-0100 27.2 usage notes 27.2.1 page conflict when the same page is accessed from different buses simultaneo usly, a conflict on the page occurs. although each access is comp leted correctly, this kind of conflict degrades the memory access speed. therefore, it is advisable to provide so ftware measures to prev ent such conflicts as far as possible. for example, no conflict will ar ise if different pages are accessed by each bus. 27.2.2 rame and ramwe bits before disabling memory operation or write access through the rame or ramwe bit, be sure to read from any address and then wr ite to the same address in each page; otherwise, the last written data in each page may not be actually written to the ram. // for page 0 mov.l #h'fff80000,r0 mov.l @r0,r1 mov.l r1,@r0 // for page 1 mov.l #h'fff82000,r0 mov.l @r0,r1 mov.l r1,@r0 // for page 2 mov.l #h'fff84000,r0 mov.l @r0,r1 mov.l r1,@r0 // for page 3 mov.l #h'fff86000,r0 mov.l @r0,r1 mov.l r1,@r0 figure 27.1 examples of re ad/write before disabling ram
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1095 of 1262 rej09b0437-0100 section 28 list of registers this section gives information on the on-chip i/o registers of this lsi as follows. 1. register addresses (by functional module, in order of the manual's section numbers): ? registers are described by functional module, in order of the manual's section numbers. ? access to reserved addresses that are not descri bed in this list of register addresses is prohibited. ? when addresses consist of 16 or 32 bits, the addresses of the msbs are given on the assumption that big-endi an mode is selected. 2. register bits: ? bit configurations of the registers are described in the same order as the list of register addresses (by functional module, in order of the manual's section numbers). ? reserved bits are indicated by " ? " in the bit name. ? no entry in the bit-name column indicates that the whole register is allocated as a counter or for holding data. 3. register states in each operating mode: ? states of the registers are described in the same order as the list of register addresses (by functional module, in order of the manual's section numbers). ? for the initial state of each bit, refer to the de scription of the register in the corresponding section. ? the register states described are for basic operating modes. if ther e is a specific reset for an on- chip peripheral module, refer to the section on that on-chip peripheral module. 4. cautions required when writing into registers in on-chip peripheral modules: accessing a register in an on-chip peripheral module takes at least two cycles of the peripheral module clock (p ) from the internal bus. when, meanwhile, writing from the cpu to an on- chip peripheral module, the cpu executes subsequent instructions without waiting for the register writing to be completed. here is an example involving a state transition to software standby mode for the purpose of reducing power consumption. this transition requires a sleep instruction to be executed after the syby bit of the stbcr register is set to 1. before the execution of the sleep instruction, actually, it is necessary to read the stbcr register on a dummy basis. in the absence of dummy reading, the cpu executes the sleep instruction before the syby bit is set to 1, so that the state occurring after the transition will be not software standby mode, but sleep mode. dummy-reading the stbcr register is thus require d to wait until writing into the stby bit is completed.
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1096 of 1262 rej09b0437-0100 if, as in this example, you want to reflect the ch ange from an on-chip peripheral register at the time of execution of a subsequent instruction, you should dummy-read the same register after the register write instruction and then execute the subsequent instruction of the target. 28.1 register addresses (by functional modul e, in order of the manual's section numbers) entries under access size indi cate the numbers of bits. note: access to undefined or reserved addresses is prohibited. since operation or continued operation is not guaranteed when these regist ers are accessed, do not attempt such access. module name register name abbreviation number of bits address access size cache cache control register 1 ccr1 32 h'fffc1000 32 cache control register 2 ccr2 32 h'fffc1004 32 intc interrupt control register 0 icr0 16 h'fffe0800 16/32 interrupt control register 1 icr1 16 h'fffe0802 16/32 irq interrupt request register irqrr 16 h'fffe0806 16/32 bank control register ibcr 16 h'fffe080c 16/32 bank number register ibnr 16 h'fffe080e 16/32 interrupt priority register 01 ipr01 16 h'fffe0818 16/32 interrupt priority register 02 ipr02 16 h'fffe081a 16/32 interrupt priority register 06 ipr06 16 h'fffe0c00 16/32 interrupt priority register 07 ipr07 16 h'fffe0c02 16/32 interrupt priority register 08 ipr08 16 h'fffe0c04 16/32 interrupt priority register 09 ipr09 16 h'fffe0c06 16/32 interrupt priority register 10 ipr10 16 h'fffe0c08 16/32 interrupt priority register 11 ipr11 16 h'fffe0c0a 16/32 interrupt priority register 12 ipr12 16 h'fffe0c0c 16/32 interrupt priority register 13 ipr13 16 h'fffe0c0e 16/32 interrupt priority register 14 ipr14 16 h'fffe0c10 16/32 interrupt priority register 15 ipr15 16 h'fffe0c12 16/32 interrupt priority register 16 ipr16 16 h'fffe0c14 16/32
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1097 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size bsc common control register cmncr 32 h'fffc0000 32 cs0 space bus control register cs0bcr 32 h'fffc0004 32 cs3 space bus control register cs3bcr 32 h'fffc0010 32 cs4 space bus control register cs4bcr 32 h'fffc0014 32 cs5 space bus control register cs5bcr 32 h'fffc0018 32 cs6 space bus control register cs6bcr 32 h'fffc001c 32 cs0 space wait control register cs0wcr 32 h'fffc0028 32 cs3 space wait control register cs3wcr 32 h'fffc0034 32 cs4 space wait control register cs4wcr 32 h'fffc0038 32 cs5 space wait control register cs5wcr 32 h'fffc003c 32 cs6 space wait control register cs6wcr 32 h'fffc0040 32 sdram control register sdcr 32 h'fffc004c 32 refresh timer control/status register rtcsr 32 h'fffc0050 32 refresh timer counter rtcnt 32 h'fffc0054 32 refresh time constant register rtcor 32 h'fffc0058 32 ac characteristics switching register acswr 32 h'fffc180c 32 internal bus master bus priority register ibmpr 32 h'fffc1818 32 ac characteristics switching key register ackeyr 8 h'fffc1bfc 32 dmac dma source address register_0 sar_0 32 h'fffe1000 16/32 dma destination address register_0 dar_0 32 h'fffe1004 16/32 dma transfer count register_0 dmatcr_0 32 h'fffe1008 16/32 dma channel control register_0 chcr_0 32 h'fffe100c 8/16/32 dma source address register_1 sar_1 32 h'fffe1010 16/32 dma destination address register_1 dar_1 32 h'fffe1014 16/32
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1098 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size dmac dma transfer count register_1 dmatcr_1 32 h'fffe1018 16/32 dma channel control register_1 chcr_1 32 h'fffe101c 8/16/32 dma source address register_2 sar_2 32 h'fffe1020 16/32 dma destination address register_2 dar_2 32 h'fffe1024 16/32 dma transfer count register_2 dmatcr_2 32 h'fffe1028 16/32 dma channel control register_2 chcr_2 32 h'fffe102c 8/16/32 dma source address register_3 sar_3 32 h'fffe1030 16/32 dma destination address register_3 dar_3 32 h'fffe1034 16/32 dma transfer count register_3 dmatcr_3 32 h'fffe1038 16/32 dma channel control register_3 chcr_3 32 h'fffe103c 8/16/32 dma source address register_4 sar_4 32 h'fffe1040 16/32 dma destination address register_4 dar_4 32 h'fffe1044 16/32 dma transfer count register_4 dmatcr_4 32 h'fffe1048 16/32 dma channel control register_4 chcr_4 32 h'fffe104c 8/16/32 dma source address register_5 sar_5 32 h'fffe1050 16/32 dma destination address register_5 dar_5 32 h'fffe1054 16/32 dma transfer count register_5 dmatcr_5 32 h'fffe1058 16/32 dma channel control register_5 chcr_5 32 h'fffe105c 8/16/32 dma source address register_6 sar_6 32 h'fffe1060 16/32 dma destination address register_6 dar_6 32 h'fffe1064 16/32 dma transfer count register_6 dmatcr_6 32 h'fffe1068 16/32
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1099 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size dmac dma channel contro l register_6 chcr_6 32 h'fffe106c 8/16/32 dma source address register_7 sar_7 32 h'fffe1070 16/32 dma destination address register_7 dar_7 32 h'fffe1074 16/32 dma transfer count register_7 dmatcr_7 32 h'fffe1078 16/32 dma channel control register_7 chcr_7 32 h'fffe107c 8/16/32 dma reload source address register_0 rsar_0 32 h'fffe1100 16/32 dma reload destination address register_0 rdar_0 32 h'fffe1104 16/32 dma reload transfer count register_0 rdmatcr_0 32 h'fffe1108 16/32 dma reload source address register_1 rsar_1 32 h'fffe1110 16/32 dma reload destination address register_1 rdar_1 32 h'fffe1114 16/32 dma reload transfer count register_1 rdmatcr_1 32 h'fffe1118 16/32 dma reload source address register_2 rsar_2 32 h'fffe1120 16/32 dma reload destination address register_2 rdar_2 32 h'fffe1124 16/32 dma reload transfer count register_2 rdmatcr_2 32 h'fffe1128 16/32 dma reload source address register_3 rsar_3 32 h'fffe1130 16/32 dma reload destination address register_3 rdar_3 32 h'fffe1134 16/32 dma reload transfer count register_3 rdmatcr_3 32 h'fffe1138 16/32 dma reload source address register_4 rsar_4 32 h'fffe1140 16/32 dma reload destination address register_4 rdar_4 32 h'fffe1144 16/32
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1100 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size dmac dma reload transfer count register_4 rdmatcr_4 32 h'fffe1148 16/32 dma reload source address register_5 rsar_5 32 h'fffe1150 16/32 dma reload destination address register_5 rdar_5 32 h'fffe1154 16/32 dma reload transfer count register_5 rdmatcr_5 32 h'fffe1158 16/32 dma reload source address register_6 rsar_6 32 h'fffe1160 16/32 dma reload destination address register_6 rdar_6 32 h'fffe1164 16/32 dma reload transfer count register_6 rdmatcr_6 32 h'fffe1168 16/32 dma reload source address register_7 rsar_7 32 h'fffe1170 16/32 dma reload destination address register_7 rdar_7 32 h'fffe1174 16/32 dma reload transfer count register_7 rdmatcr_7 32 h'fffe1178 16/32 dma operation register dmaor 16 h'fffe1200 8/16 dm extension resource selector 0 dmars0 16 h'fffe1300 16 dm extension resource selector 1 dmars1 16 h'fffe1304 16 dm extension resource selector 2 dmars2 16 h'fffe1308 16 dm extension resource selector 3 dmars3 16 h'fffe130c 16 cpg frequency control register frqcr 16 h'fffe0010 16 wdt watchdog timer control/status register wtcsr 8 h'fffe0000 16
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1101 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size wdt watchdog timer counter wtcnt 8 h'fffe0002 16 watchdog reset control/status register wrcsr 8 h'fffe0004 16 power-down mode standby control register stbcr 8 h'fffe0014 8 standby control register 2 stbcr2 8 h'fffe0018 8 system control register 1 syscr1 8 h'fffe0402 8 system control register 2 syscr2 8 h'fffe0404 8 standby control register 3 stbcr3 8 h'fffe0408 8 standby control register 4 stbcr4 8 h'fffe040c 8 system control register 3 syscr3 8 h'fffe0418 8 etherc etherc mode register ecmr 32 h'fffc2160 32 etherc status register ecsr 32 h'fffc2164 32 etherc interrupt enable register ecsipr 32 h'fffc2168 32 phy section interface register pir 32 h'fffc216c 32 mac higher-order address register mahr 32 h'fffc2170 32 mac lower-order address register malr 32 h'fffc2174 32 upper receive frame length limit register rflr 32 h'fffc2178 32 phy section status register psr 32 h'fffc217c 32 transmit retry counter register trocr 32 h'fffc2180 32 delay collision detection counter register cdcr 32 h'fffc2184 32 carrier loss counter register lccr 32 h'fffc2188 32 undetected carrier counter register cndcr 32 h'fffc218c 32 crc error frame reception counter register cefcr 32 h'fffc2194 32 frame reception error counter register frecr 32 h'fffc2198 32
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1102 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size etherc lower than 64 bytes frame reception counter register tsfrcr 32 h'fffc219c 32 excessive bytes frame reception counter register tlfrcr 32 h'fffc21a0 32 fractional bits frame reception counter register rfcr 32 h'fffc21a4 32 multicast address frame reception counter register mafcr 32 h'fffc21a8 32 ipg setting register ipgr 32 h'fffc21b4 32 automatic pause frame setting register apr 32 h'fffc21b8 32 manual pause frame setting register mpr 32 h'fffc21bc 32 automatic pause frame resend count setting register tpauser 32 h'fffc21c4 32 e-dmac e-dmac mode register edmr 32 h'fffc2000 32 e-dmac send request register edtrr 32 h'fffc2004 32 e-dmac receive request register edrrr 32 h'fffc2008 32 transmit descriptor list's starting address register tdlar 32 h'fffc200c 32 receive descriptor list's starting address register rdlar 32 h'fffc2010 32 etherc/e-dmac status register eesr 32 h'fffc2014 32 etherc/e-dmac status interrupt enable register eesipr 32 h'fffc2018 32 transmit /receive status copying register trscer 32 h'fffc201c 32 missed frames counter register rmfcr 32 h'fffc2020 32 transmit fifo threshold value register tftr 32 h'fffc2024 32 fifo capacity register fdr 32 h'fffc2028 32 receive method control register rmcr 32 h'fffc202c 32
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1103 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size e-dmac e-dmac operation control register edocr 32 h'fffc2030 32 flow control start fifo threshold value register fcftr 32 h'fffc2034 32 receive data padding setting register rpadir 32 h'fffc2038 32 transmit interrupt setting register trimd 32 h'fffc203c 32 receive buffer write address register rbwar 32 h'fffc2040 32 receive descriptor fetch address register rdfar 32 h'fffc2044 32 transmit buffer read address register tbrar 32 h'fffc204c 32 transmit descriptor fetch address register tdfar 32 h'fffc2050 32 checksum mode register csmr 32 h'fffc20e4 32 checksum skipped bytes monitor register cssbm 32 h'fffc20e8 32 checksum monitor register cssmr 32 h'fffc20ec 32 a-dmac channel 0 processing control register c0c 32 h'fffc2440 32 channel 0 processing mode register c0m 32 h'fffc2444 32 channel 0 processing interrupt request register c0i 32 h'fffc2448 32 channel 0 processing descriptor starting address register c0dsa 32 h'fffc247c 32 channel 0 processing descriptor current address register c0dca 32 h'fffc2480 32 channel 0 processing descriptor 0 register c0d0 32 h'fffc2484 32 channel 0 processing descriptor 1 register c0d1 32 h'fffc2488 32
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1104 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size a-dmac channel 0 processing descriptor 2 register c0d2 32 h'fffc248c 32 channel 0 processing descriptor 3 register c0d3 32 h'fffc2490 32 channel 0 processing descriptor 4 register c0d4 32 h'fffc2494 32 channel 1 processing control register c1c 32 h'fffc24b0 32 channel 1 processing mode register c1m 32 h'fffc24b4 32 channel 1 processing interrupt request register c1i 32 h'fffc24b8 32 channel 1 processing descriptor starting address register c1dsa 32 h'fffc24ec 32 channel 1 processing descriptor current address register c1dca 32 h'fffc24f0 32 channel 1 processing descriptor 0 register c1d0 32 h'fffc24f4 32 channel 1 processing descriptor 1 register c1d1 32 h'fffc24f8 32 channel 1 processing descriptor 2 register c1d2 32 h'fffc24fc 32 channel 1 processing descriptor 3 register c1d3 32 h'fffc2500 32 channel 1 processing descriptor 4 register c1d4 32 h'fffc2504 32 fec dmac processing control register fecc 32 h'fffc2590 32 fec dmac processing interrupt request register feci 32 h'fffc2594 32 fec dmac processing descriptor starting address register fecdsa 32 h'fffc2598 32
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1105 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size a-dmac fec dmac processing descriptor current address register fecdca 32 h'fffc259c 32 fec dmac processing descriptor 0 register fecd00 32 h'fffc25a0 32 fec dmac processing descriptor 1 register fecd01d0a 32 h'fffc25a4 32 fec dmac processing descriptor 2 register fecd02s0a 32 h'fffc25a8 32 fec dmac processing descriptor 3 register fecd03s1a 32 h'fffc25ac 32 stif0 stif mode select regi ster_0 stmdr_0 32 h'ffffd000 32 stif control register _0 stctlr_0 32 h'ffffd004 32 stif internal counter control register_0 stcntcr_0 32 h'ffffd008 32 stif internal counter value setting register_0 stcntvr_0 32 h'ffffd00c 32 stif status register_0 ststr_0 32 h'ffffd010 32 stif interrupt enable register_0 stier_0 32 h'ffffd014 32 stif transfer size register_0 stsizer_0 32 h'ffffd018 32 stif pwm mode register_0 stpwmmr_ 0 32 h'ffffd 020 32 stif pwm control register_0 stpwmcr_ 0 32 h'ffffd 024 32 stif pwm register_0 stpwmr_0 32 h'ffffd028 32 stif pcr0 register_0 stpcr0r_0 32 h'ffffd02c 32 stif pcr1 register_0 stpcr1r_0 32 h'ffffd030 32 stif stc0 register_0 ststc0r_0 32 h'ffffd034 32 stif stc1 register_0 ststc1r_0 32 h'ffffd038 32 stif lock control regist er_0 stlkcr_0 32 h'ffffd03c 32 stif1 stif mode select regi ster_1 stmdr_1 32 h'ffffd800 32 stif control register _1 stctlr_1 32 h'ffffd804 32
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1106 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size stif1 stif internal counter control register_1 stcntcr_1 32 h'ffffd808 32 stif internal counter value setting register_1 stcntvr_1 32 h'ffffd80c 32 stif status register_1 ststr_1 32 h'ffffd810 32 stif interrupt enable register_1 stier_1 32 h'ffffd814 32 stif transfer size register_1 stsizer_1 32 h'ffffd818 32 stif pwm mode register_1 stpwmmr_ 1 32 h'ffffd 820 32 stif pwm control register_1 stpwmcr_ 1 32 h'ffffd 824 32 stif pwm register_1 stpwmr_1 32 h'ffffd828 32 stif pcr0 register_1 stpcr0r_1 32 h'ffffd82c 32 stif pcr1 register_1 stpcr1r_1 32 h'ffffd830 32 stif stc0 register_1 ststc0r_1 32 h'ffffd834 32 stif stc1 register_1 ststc1r_1 32 h'ffffd838 32 stif lock control regist er_1 stlkcr_1 32 h'ffffd83c 32 ssi ssi clock selection register_0 scsr_0 16 h'ffff0000 16 ssi clock selection register_1 scsr_1 16 h'ffff0800 16 control register_0 ssicr_0 32 h'ffffc000 32 status register _0 ssisr_0 32 h'ffffc004 32 transmit data register _0 ssitdr_0 32 h'ffffc 008 32 receive data register_0 ssirdr _0 32 h'ffffc 00c 32 control register_1 ssicr_1 32 h'ffffc800 32 status register _1 ssisr_1 32 h'ffffc804 32 transmit data register _1 ssitdr_1 32 h'ffffc 808 32 receive data register_1 ssirdr _1 32 h'ffffc 80c 32 usb d0fifo bus wait setting register d0fwait 16 h'fffc1c0c 16 d1fifo bus wait setting register d1fwait 16 h'fffc1c0e 16
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1107 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size usb d0fifo port register d0fifo 32 h'fffc1c14 32 d1fifo port register d1fifo 32 h'fffc1c18 32 system configuration control register syscfg 16 h'fffff800 16 cpu bus wait setting register buswait 16 h'fffff802 16 system configuration status register syssts 16 h'fffff804 16 device control regist er dvstctr 16 h'fffff808 16 test mode register t estmode 16 h'fffff80c 16 d0fifo bus configuration register d0fbcfg 16 h'fffff810 16 d1fifo bus configuration register d1fbcfg 16 h'fffff812 16 cfifo port register cfifo 16 h'fffff814 16 cfifo port selection regist er cfifosel 16 h'fffff820 16 cfifo port control register cfifoctr 16 h'fffff822 16 d0cfifo port selection register d0fifosel 16 h'fffff828 16 d0fifo port control regist er d0fifoctr 16 h'fffff82a 16 d1cfifo port selection register d1fifosel 16 h'fffff82c 16 d1fifo port control regist er d1fifoctr 16 h'fffff82e 16 interrupt enable register 0 intenb0 16 h'fffff830 16 interrupt enable register 1 intenb1 16 h'fffff832 16 brdy interrupt enable register brdyenb 16 h'fffff836 16 nrdy interrupt enable register nrdyenb 16 h'fffff838 16 bemp interrupt enable register bempenb 16 h'fffff83a 16 sof output configuration register sofcfg 16 h'fffff83c 16 interrupt status register 0 intsts0 16 h'fffff840 16 interrupt status register 1 intsts1 16 h'fffff842 16 brdy interrupt status r egister brdysts 16 h'fffff846 16
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1108 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size usb nrdy interrupt status register nrdysts 16 h'fffff848 16 bemp interrupt status regi ster bempsts 16 h'fffff84a 16 frame number register frmnum 16 h'fffff84c 16 frame number register ufrmnum 16 h'fffff84e 16 usb address register usbaddr 16 h'fffff850 16 usb request type register usbreq 16 h'fffff854 16 usb request value register usbval 16 h'fffff856 16 usb request index regist er usbindx 16 h'fffff858 16 usb request length register usbleng 16 h'fffff85a 16 dcp configuration regist er dcpcfg 16 h'fffff85c 16 dcp maximum packet size register dcpmaxp 16 h'fffff85e 16 dcp control register dcpctr 16 h'fffff860 16 pipe window selection re gister pipesel 16 h'fffff864 16 pipe configuration regist er pipecfg 16 h'fffff868 16 pipe buffer register pipebuf 16 h'fffff86a 16 pipe maximum packet size register pipemaxp 16 h'fffff86c 16 pipe cycle control register pipeperi 16 h'fffff86e 16 pipe1 control register pipe1ctr 16 h'fffff870 16 pipe2 control register pipe2ctr 16 h'fffff872 16 pipe3 control register pipe3ctr 16 h'fffff874 16 pipe4 control register pipe4ctr 16 h'fffff876 16 pipe5 control register pipe5ctr 16 h'fffff878 16 pipe6 control register pipe6ctr 16 h'fffff87a 16 pipe7 control register pipe7ctr 16 h'fffff87c 16 pipe8 control register pipe8ctr 16 h'fffff87e 16 pipe9 control register pipe9ctr 16 h'fffff880 16 pipe1 transaction counter enable register pipe1tre 16 h'fffff890 16
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1109 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size usb pipe1 transaction counter register pipe1trn 16 h'fffff892 16 pipe2 transaction counter enable register pipe2tre 16 h'fffff894 16 pipe2 transaction counter register pipe2trn 16 h'fffff896 16 pipe3 transaction counter enable register pipe3tre 16 h'fffff898 16 pipe3 transaction counter register pipe3trn 16 h'fffff89a 16 pipe4 transaction counter enable register pipe4tre 16 h'fffff89c 16 pipe4 transaction counter register pipe4trn 16 h'fffff89e 16 pipe5 transaction counter enable register pipe5tre 16 h'fffff8a0 16 pipe5 transaction counter register pipe5trn 16 h'fffff8a2 16 device address 0 configuration register devadd0 16 h'fffff8d0 16 device address 1 configuration register devadd1 16 h'fffff8d2 16 device address 2 configuration register devadd2 16 h'fffff8d4 16 device address 3 configuration register devadd3 16 h'fffff8d6 16 device address 4 configuration register devadd4 16 h'fffff8d8 16 device address 5 configuration register devadd5 16 h'fffff8da 16 device address 6 configuration register devadd6 16 h'fffff8dc 16 device address 7 configuration register devadd7 16 h'fffff8de 16 device address 8 configuration register devadd8 16 h'fffff8e0 16
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1110 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size usb device address 9 configuration register devadd9 16 h'fffff8e2 16 device address a configuration register devadda 16 h'fffff8e4 16 iic3 i2c bus control register 1_0 iccr1_0 8 h'fffee000 8 i2c bus control register 2_0 iccr2_0 8 h'fffee001 8 i2c bus mode register_0 icmr_0 8 h'fffee002 8 i2c bus interrupt enable register_0 icier_0 8 h'fffee003 8 i2c bus status register_0 icsr_0 8 h'fffee004 8 slave address register_0 sar_0 8 h'fffee005 8 i2c bus transmit data register_0 icdrt_0 8 h'fffee006 8 i2c bus receive data regi ster_0 icdrr_0 8 h'fffee007 8 nf2cyc register_0 nf2cyc_0 8 h'fffee008 8 hif hif index register hifidx 32 h'ffffe000 32 hif general status register hifgsr 32 h'ffffe004 32 hif status/control regi ster hifscr 32 h'ffffe008 32 hif memory control register hifmcr 32 h'ffffe00c 32 hif internal interrupt control register hifiicr 32 h'ffffe010 32 hif external interrupt control register hifeicr 32 h'ffffe014 32 hif address register hifadr 32 h'ffffe018 32 hif data register hifdata 32 h'ffffe01c 32 hif dreq trigger register hifdtr 32 h'ffffe020 32 hif bank interrupt control register hifbicr 32 h'ffffe024 32 hif boot control register hifbcr 32 h'ffffe040 32 cmt compare match timer start register cmstr 16 h'fffec000 16 compare match timer control/status register_0 cmcsr_0 16 h'fffec002 16
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1111 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size cmt compare match counter_0 cmcnt_0 16 h'fffec004 8/16 compare match constant register_0 cmcor_0 16 h'fffec006 8/16 compare match timer control/status register_1 cmcsr_1 16 h'fffec008 16 compare match counter_1 cmcnt_1 16 h'fffec00a 8/16 compare match constant register_1 cmcor_1 16 h'fffec00c 8/16 scif0 serial mode register_0 scsmr_0 16 h'fffe8000 16 bit rate register_0 scbrr_0 8 h'fffe8004 8 serial control register_0 scscr_0 16 h'fffe8008 16 transmit fifo data register_0 scftdr_0 8 h'fffe800c 8 serial status register_0 scfsr_0 16 h'fffe8010 16 receive fifo data regist er_0 scfrdr_0 8 h'fffe8014 8 fifo control register_0 scfcr_0 16 h'fffe8018 16 fifo data count set register_0 scfdr_0 16 h'fffe801c 16 serial port register_0 scsptr_0 16 h'fffe8020 16 line status register _0 sclsr_0 16 h'fffe8024 16 scif1 serial mode register_1 scsmr_1 16 h'fffe8800 16 bit rate register_1 scbrr_1 8 h'fffe8804 8 serial control register_1 scscr_1 16 h'fffe8808 16 transmit fifo data register_1 scftdr_1 8 h'fffe880c 8 serial status register_1 scfsr_1 16 h'fffe8810 16 receive fifo data regist er_1 scfrdr_1 8 h'fffe8814 8 fifo control register_1 scfcr_1 16 h'fffe8818 16 fifo data count set register_1 scfdr_1 16 h'fffe881c 16 serial port register_1 scsptr_1 16 h'fffe8820 16 line status register _1 sclsr_1 16 h'fffe8824 16 scif2 serial mode register_2 scsmr_2 16 h'fffe9000 16 bit rate register_2 scbrr_2 8 h'fffe9004 8 serial control register_2 scscr_2 16 h'fffe9008 16
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1112 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size scif2 transmit fifo data regi ster_2 scftdr_2 8 h'fffe900c 8 serial status register_2 scfsr_2 16 h'fffe9010 16 receive fifo data regist er_2 scfrdr_2 8 h'fffe9014 8 fifo control register_2 scfcr_2 16 h'fffe9018 16 fifo data count set register_2 scfdr_2 16 h'fffe901c 16 serial port register_2 scsptr_2 16 h'fffe9020 16 line status register _2 sclsr_2 16 h'fffe9024 16 i/o port a data register h padrh 16 h'fffe3800 8/16 port a io register h paiorh 16 h'fffe3804 8/16 port a control register h2 pacrh2 16 h'fffe3808 8/16 port a control register h1 pacrh1 16 h'fffe380a 8/16 port b data register l pbdrl 16 h'fffe3882 8/16 port b io register l pbiorl 16 h'fffe3886 8/16 port b control register l1 pbcrl1 16 h'fffe388e 8/16 port c data register h pcdrh 16 h'fffe3900 8/16 port c data register l pcdrl 16 h'fffe3902 8/16 port c io register h pciorh 16 h'fffe3904 8/16 port c io register l pciorl 16 h'fffe3906 8/16 port c control register h1 pccrh1 16 h'fffe390a 8/16 port c control register l2 pccrl2 16 h'fffe390c 8/16 port c control register l1 pccrl1 16 h'fffe390e 8/16 port d data register l pddrl 16 h'fffe3982 8/16 port d io register l pdiorl 16 h'fffe3986 8/16 port d control register l1 pdcrl1 16 h'fffe398e 8/16 port e data register l pedrl 16 h'fffe3a02 8/16 port e io register l peiorl 16 h'fffe3a06 8/16 port e control register l2 pecrl2 16 h'fffe3a0c 8/16 port e control register l1 pecrl1 16 h'fffe3a0e 8/16 port f data register l pfdrl 16 h'fffe3a82 8/16 port f io register l pfiorl 16 h'fffe3a86 8/16
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1113 of 1262 rej09b0437-0100 module name register name abbreviation number of bits address access size i/o port f control register l2 pfcrl2 16 h'fffe3a8c 8/16 port f control register l1 pfcrl1 16 h'fffe3a8e 8/16 port g data register h pgdrh 16 h'fffe3b00 8/16 port g data register l pgdrl 16 h'fffe3b02 8/16 port g io register h pgiorh 16 h'fffe3b04 8/16 port g io register l pgiorl 16 h'fffe3b06 8/16 port g control register h2 pgcrh2 16 h'fffe3b0a 8/16 port g control register l2 pgcrl2 16 h'fffe3b0c 8/16 port g control register l1 pgcrl1 16 h'fffe3b0e 8/16 ubc break address register_0 bar_0 32 h'fffc0400 32 break address mask register_0 bamr_0 32 h'fffc0404 32 break data register _0 bdr_0 32 h'fffc0408 32 break data mask register_0 bdmr_0 32 h'fffc040c 32 break address register_1 bar_1 32 h'fffc0410 32 break address mask register_1 bamr_1 32 h'fffc0414 32 break data register _1 bdr_1 32 h'fffc0418 32 break data mask register_1 bdmr_1 32 h'fffc041c 32 break bus cycle register_0 bbr_0 16 h'fffc04a0 16 break bus cycle register_1 bbr_1 16 h'fffc04b0 16 break control register brcr 32 h'fffc04c0 32 h-udi instruction register sdir 16 h'fffe2000 16
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1114 of 1262 rej09b0437-0100 28.2 register bits register addresses and bit names of the on-chip peripheral modules are described below. each line covers eight bits, and 16-bit and 32-bit registers are shown as 2 or 4 lines, respectively. module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 cache ccr1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? icf ? ? ice ? ? ? ? ocf ? wt oce ccr2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? w3lord w3lock ? ? ? ? ? ? w2lord w2lock intc icr0 nmil ? ? ? ? ? ? nmie ? ? ? ? ? ? ? ? icr1 irq71s irq70s irq61s irq 60s irq51s irq50s irq41s irq40s irq31s irq30s irq21s irq20s irq11s irq10s irq01s irq00s irqrr ? ? ? ? ? ? ? ? irq7f irq6f irq5f irq4 f irq3f irq2f irq1f irq0f ibcr e15 e14 e13 e12 e11 e10 e9 e8 e7 e6 e5 e4 e3 e2 e1 ? ibnr be1 be0 bove ? ? ? ? ? ? ? ? ? bn3 bn2 bn1 bn0 ipr01 ipr02 ipr06
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1115 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 intc ipr07 ipr08 ipr09 ipr10 ipr11 ipr12 ipr13 ipr14 ipr15 ipr16 bsc cmncr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dmaiw2 dmaiw1 dmaiw0 dmaiwa ? ? ? hizmem hizcnt cs0bcr ? iww2 iww1 iww0 iwrwd2 iwrwd1 iwrwd0 iwrws2 iwrws1 iwrws0 iwrrd2 iwrrd1 iwrrd0 iwrrs2 iwrrs1 iwrrs0 ? type2 type1 type0 endian bsz1 bsz0 ? ? ? ? ? ? ? ? ?
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1116 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 bsc cs3bcr ? iww2 iww1 iww0 iwrwd2 iwrwd1 iwrwd0 iwrws2 iwrws1 iwrws0 iwrrd2 iwrrd1 iwrrd0 iwrrs2 iwrrs1 iwrrs0 ? type2 type1 type0 endian bsz1 bsz0 ? ? ? ? ? ? ? ? ? cs4bcr ? iww2 iww1 iww0 iwrwd2 iwrwd1 iwrwd0 iwrws2 iwrws1 iwrws0 iwrrd2 iwrrd1 iwrrd0 iwrrs2 iwrrs1 iwrrs0 ? type2 type1 type0 endian bsz1 bsz0 ? ? ? ? ? ? ? ? ? cs5bcr ? iww2 iww1 iww0 iwrwd2 iwrwd1 iwrwd0 iwrws2 iwrws1 iwrws0 iwrrd2 iwrrd1 iwrrd0 iwrrs2 iwrrs1 iwrrs0 ? type2 type1 type0 endian bsz1 bsz0 ? ? ? ? ? ? ? ? ? cs6bcr ? iww2 iww1 iww0 iwrwd2 iwrwd1 iwrwd0 iwrws2 iwrws1 iwrws0 iwrrd2 iwrrd1 iwrrd0 iwrrs2 iwrrs1 iwrrs0 ? type2 type1 type0 endian bsz1 bsz0 ? ? ? ? ? ? ? ? ? cs0wcr ? ? ? ? ? ? ? ? ? ? ? bas ? ? ? ? ? ? ? sw1 sw0 wr3 wr2 wr1 wr0 wm ? ? ? ? hw1 hw0 cs3wcr ? ? ? ? ? ? ? ? ? ? ? bas ? ? ? ? ? ? ? ? ? wr3 wr2 wr1 wr0 wm ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? wtrp1 wtrp0 ? wtrcd1 wtrcd0 ? a3cl1 cs3wcr (when sdram is connected) a3cl0 ? ? trwl1 trwl0 ? wtrc1 wtrc0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1117 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 bsc cs4wcr ? ? ? ? ? ? ? ? ? ? ? bas ? ww2 ww1 ww0 ? ? ? sw1 sw0 wr3 wr2 wr1 wr0 wm ? ? ? ? hw1 hw0 cs5bwcr ? ? ? ? ? ? ? ? ? ? ? bas ? ww2 ww1 ww0 ? ? ? sw1 sw0 wr3 wr2 wr1 wr0 wm ? ? ? ? hw1 hw0 ? ? ? ? ? ? ? ? ? ? sa1 sa0 ? ? ? ? ? ted3 ted2 ted1 te d0 pcw3 pcw2 pcw1 cs5bwcr (when pcmcia is connected) pcw0 wm ? ? teh3 teh2 teh1 teh0 cs6bwcr ? ? ? ? ? ? ? ? ? ? ? bas ? ? ? ? ? ? ? sw1 sw0 wr3 wr2 wr1 wr0 wm ? ? ? ? hw1 hw0 ? ? ? ? ? ? ? ? ? ? sa1 sa0 ? ? ? ? ? ted3 ted2 ted1 te d0 pcw3 pcw2 pcw1 cs6bwcr (when pcmcia is connected) pcw0 wm ? ? teh3 teh2 teh1 teh0 sdcr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? deep ? rfsh rmode pdown bactv ? ? ? a3row1 a3row0 ? a3col1 a3col0 rtcsr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cmf cmie cks2 cks1 cks0 rrc2 rrc1 rrc0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1118 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 bsc rtcnt ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rtcor ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 acswr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? acosw3 acosw2 acosw1 acosw0 ibmpr ? ? op1r1 op1r0 ? ? op2r1 op2r0 ? ? op3r1 op3r0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ackeyr ackey[7:0] dmac sar_0 dar_0 dmatcr_ 0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1119 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 dmac chcr_0 tc ? rldsar rlddar ? ? ? ? do tl ? temask he hie am al dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 dl ds tb ts1 ts0 ie te de sar_1 dar_1 dmatcr_ 1 chcr_1 tc ? rldsar rlddar ? ? ? ? do tl ? temask he hie am al dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 dl ds tb ts1 ts0 ie te de sar_2 dar_2
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1120 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 dmac dmatcr_ 2 chcr_2 tc ? rldsar rlddar ? ? ? ? ? ? ? temask he hie ? ? dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 ? ? tb ts1 ts0 ie te de sar_3 dar_3 dmatcr_ 3 dmatcr_ 2 chcr_3 tc ? rldsar rlddar ? ? ? ? ? ? ? temask he hie ? ? dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 ? ? tb ts1 ts0 ie te de sar_4
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1121 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 dmac dar_4 dmatcr_ 4 chcr_4 tc ? rldsar rlddar ? ? ? ? ? ? ? temask he hie ? ? dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 ? ? tb ts1 ts0 ie te de sar_5 dar_5 dmatcr_ 5 chcr_5 tc ? rldsar rlddar ? ? ? ? ? ? ? temask he hie ? ? dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 ? ? tb ts1 ts0 ie te de
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1122 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 dmac sar_6 dar_6 dmatcr_ 6 chcr_6 tc ? rldsar rlddar ? ? ? ? ? ? ? temask he hie ? ? dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 ? ? tb ts1 ts0 ie te de sar_7 dar_7 dmatcr_ 7
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1123 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 dmac chcr_7 tc ? rldsar rlddar ? ? ? ? ? ? ? temask he hie ? ? dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 ? ? tb ts1 ts0 ie te de rsar_0 rdar_0 rdmatcr _0 rsar_1 rdar_1 rdmatcr _1
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1124 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 dmac rsar_2 rdar_2 rdmatcr _2 rsar_3 rdar_3 rdmatcr _3 rsar_4
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1125 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 dmac rdar_4 rdmatcr _4 rsar_5 rdar_5 rdmatcr _5 rsar_6 rdar_6
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1126 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 dmac sar_6 dar_6 dmatcr_ 6 chcr_6 sar_7 ? ? cms1 cms0 ? ? pr1 pr0 ? ? ? ? ? ae nmif dme ch1 mid[5:0] ch1 rid[1:0] ch0 mid[5:0] ch0 rid[1:0] dar_7 ch3 mid[5: 0] ch3 rid[1:0] ch2 mid[5:0] ch2 rid[1:0] ch5 mid[5:0] ch5 rid[1:0] ch4 mid[5:0] ch4 rid[1:0] dmatcr_ 7 ch7 mid[5:0] ch7rid[1:0] sar_6 ch6 mid[5:0] ch6 rid[1:0] cpg ? ? ckoen1 ckoen0 ? ? stc1 stc0 ? ? ? ifc ? pfc2 pfc1 pfc0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1127 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 wdt wtcsr iovf wt/ it tme ? ? cks2 cks1 cks0 wtcnt bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 wrcsr wovf rste rsts ? ? ? ? ? stbcr stby ? ? ? ? ? ? ? stbcr2 mstp10 mstp9 mstp8 mstp7 ? ? ? ? power- down mode syscr1 ? ? ? ? rame3 rame2 rame1 rame0 syscr2 ? ? ? ? ramwe3 ramwe2 ramwe1 ramwe0 stbcr3 hiz mstp36 mstp35 mstp 34 mstp33 mstp32 mstp31 mstp30 stbcr4 ? mstp46 mstp45 mstp44 mstp43 mstp42 mstp41 mstp40 syscr3 ? ? ? ? ? ? ssi1srst ssi0srst etherc ecmr ? ? ? ? ? ? ? ? ? ? ? ? zpf pfr rxf txf ? ? ? prcef ? ? mpde ? ? pe te ? ilb elb dm prm ecsr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? psrto ? lchng mpd icd ecsipr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? psrtoip ? lchngip mpdip icdip pir ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mdi mdo mmd mdc mahr ma47 ma46 ma45 ma44 ma43 ma42 ma41 ma40 ma39 ma38 ma37 ma36 ma35 ma34 ma33 ma32 ma31 ma30 ma29 ma28 ma27 ma26 ma25 ma24 ma23 ma22 ma21 ma20 ma19 ma18 ma17 ma16
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1128 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 etherc malr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ma15 ma14 ma13 ma12 ma11 ma10 ma9 ma8 ma7 ma6 ma5 ma4 ma3 ma2 ma1 ma0 rflr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? rfl11 rfl10 rfl9 rfl8 rfl7 rfl6 rfl5 rfl4 rfl3 rfl2 rfl1 rfl0 psr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? lmon trocr troc31 troc30 troc29 troc 28 troc27 troc26 troc25 troc24 troc23 troc22 troc21 troc20 troc19 troc18 troc17 troc16 troc15 troc14 troc13 troc 12 troc11 troc10 troc9 troc8 troc7 troc6 troc5 troc 4 troc3 troc2 troc1 troc0 cdcr cosdc31 cosdc30 cosdc29 cosdc 28 cosdc27 cosdc26 cosdc25 cosdc24 cosdc23 cosdc22 cosdc21 cosdc 20 cosdc19 cosdc18 cosdc17 cosdc16 cosdc15 cosdc14 cosdc13 cosdc 12 cosdc11 cosdc10 cosdc9 cosdc8 cosdc7 cosdc6 cos dc5 cosdc4 cosdc3 co sdc2 cosdc1 cosdc0 lccr lcc31 lcc30 lcc29 l cc28 lcc27 lcc26 lcc25 lcc24 lcc23 lcc22 lcc21 lcc 20 lcc19 lcc18 lcc17 lcc16 lcc15 lcc14 lcc13 lcc12 lcc11 lcc10 lcc9 lcc8 lcc7 lcc6 lcc5 lcc4 lcc3 lcc2 lcc1 lcc0 cndcr cndc31 cndc30 cndc29 cndc28 cndc27 cndc26 cndc25 cndc24 cndc23 cndc22 cndc21 cndc20 cndc19 cndc18 cndc17 cndc16 cndc15 cndc14 cndc13 cndc12 cndc11 cndc10 cndc9 cndc8 cndc7 cndc6 cndc5 cndc4 cndc3 cndc2 cndc1 cndc0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1129 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 etherc cefcr cefc31 cefc30 cefc29 cefc28 cefc27 cefc26 cefc25 cefc24 cefc23 cefc22 cefc21 cefc20 cefc19 cefc18 cefc17 cefc16 cefc15 cefc14 cefc13 cefc12 cefc11 cefc10 cefc9 cefc8 cefc7 cefc6 cefc5 cefc4 cefc3 cefc2 cefc1 cefc0 frecr frec31 frec30 frec29 fr ec28 frec27 frec26 frec25 frec24 frec23 frec22 frec21 frec 20 frec19 frec18 frec17 frec16 frec15 frec14 frec13 frec 12 frec11 frec10 frec9 frec8 frec7 frec6 frec5 frec 4 frec3 frec2 frec1 frec0 tsfrcr tsfc31 tsfc30 tsfc29 tsfc28 tsfc27 tsfc26 tsfc25 tsfc24 tsfc23 tsfc22 tsfc21 tsfc20 tsfc19 tsfc18 tsfc17 tsfc16 tsfc15 tsfc14 tsfc13 tsfc12 tsfc11 tsfc10 tsfc9 tsfc8 tsfc7 tsfc6 tsfc5 tsfc4 tsfc3 tsfc2 tsfc1 tsfc0 tlfrcr tlfc31 tlfc30 tlfc29 tlfc28 tlfc27 tlfc26 tlfc25 tlfc24 tlfc23 tlfc22 tlfc21 tlfc20 tlfc19 tlfc18 tlfc17 tlfc16 tlfc15 tlfc14 tlfc13 tlfc12 tlfc11 tlfc10 tlfc9 tlfc8 tlfc7 tlfc6 tlfc5 tlfc4 tlfc3 tlfc2 tlfc1 tlfc0 rfcr rfc31 rfc30 rfc29 rfc 28 rfc27 rfc26 rfc25 rfc24 rfc23 rfc22 rfc21 rfc 20 rfc19 rfc18 rfc17 rfc16 rfc15 rfc14 rfc13 rfc 12 rfc11 rfc10 rfc9 rfc8 rfc7 rfc6 rfc5 rfc4 rfc3 rfc2 rfc1 rfc0 mafcr mafc31 mafc30 mafc29 mafc28 mafc27 mafc26 mafc25 mafc24 mafc23 mafc22 mafc21 mafc20 mafc19 mafc18 mafc17 mafc16 mafc15 mafc14 mafc13 mafc12 mafc11 mafc10 mafc9 mafc8 mafc7 mafc6 mafc5 mafc4 mafc3 mafc2 mafc1 mafc0 ipgr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ipg4 ipg3 ipg2 ipg1 ipg0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1130 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 etherc apr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ap15 ap14 ap13 ap12 ap11 ap10 ap9 ap8 ap7 ap6 ap5 ap4 ap3 ap2 ap1 ap0 mpr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mp15 mp14 mp13 mp12 mp11 mp10 mp9 mp8 mp7 mp6 mp5 mp4 mp3 mp2 mp1 mp0 tpauser ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? tpause15 tpause14 tpause13 tpause1 2 tpause11 tpause10 tpause9 tpause8 tpause7 tpause6 tpau se5 tpause4 tpause3 t pause2 tpause1 tpause0 e-dmac edmr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? de dl1 dl0 ? ? ? swr edtrr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? tr edrrr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? rr tdlar tdla31 tdla30 tdla29 td la28 tdla27 tdla26 tdla25 tdla24 tdla23 tdla22 tdla21 tdla 20 tdla19 tdla18 tdla17 tdla16 tdla15 tdla14 tdla13 tdla 12 tdla11 tdla10 tdla9 tdla8 tdla7 tdla6 tdla5 tdla4 tdla3 tdla2 tdla1 tdla0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1131 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 e-dmac rdlar rdla31 rdla30 rdla29 rdla28 rdla27 rdla26 rdla25 rdla24 rdla23 rdla22 rdla21 rdla20 rdla19 rdla18 rdla17 rdla16 rdla15 rdla14 rdla13 rdla12 rdla11 rdla10 rdla9 rdla8 rdla7 rdla6 rdla5 rdla4 rdla3 rdla2 rdla1 rdla0 eesr ? twb ? ? ? tabt rabt rfcof ade eci tc tde tfuf fr rde rfof ? ? ? ? cnd dlc cd tro rmaf ? ? rrf rtlf rtsf pre cerf eesipr ? twbip ? ? ? tabtip rabtip rfcofip adeip eciip tcip tdeip tfufip frip rdeip rfofip ? ? ? ? cndip dlcip cdip troip rmafip ? ? rrfip rtlfip rtsfip preip cerfip trscer ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cndce dlcce cdce troce rmafce ? ? rrfce rtlfce rtsfce prece cerfce rmfcr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mfc15 mfc14 mfc13 mfc 12 mfc11 mfc10 mfc9 mfc8 mfc7 mfc6 mfc5 mfc4 mfc3 mfc2 mfc1 mfc0 tftr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? tft10 tft9 tft8 tft7 tft6 tft5 tft4 tft3 tft2 tft1 tft0 fdr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? tfd2 tfd1 tfd0 ? ? ? ? ? rfd2 rfd1 rfd0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1132 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 e-dmac rmcr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? rnc edocr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fec aec edh ? fcftr ? ? ? ? ? ? ? ? ? ? ? ? ? rff2 rff1 rff0 ? ? ? ? ? ? ? ? ? ? ? ? ? rfd2 rfd1 rfd0 rpadir ? ? ? ? ? ? ? ? ? ? ? ? ? ? pads1 pads0 ? ? ? ? ? ? ? ? ? ? padr5 padr4 padr3 padr2 padr1 padr0 trimd ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? tis rbwar rbwa31 rbwa30 rbwa29 rb wa28 rbwa27 rbwa26 rbwa25 rbwa24 rbwa23 rbwa22 rbwa21 rbwa20 rbwa19 rbwa18 rbwa17 rbwa16 rbwa15 rbwa14 rbwa13 rbwa12 rbwa11 rbwa10 rbwa9 rbwa8 rbwa7 rbwa6 rbwa5 rbwa4 rbwa3 rbwa2 rbwa1 rbwa0 rdfar rdfa31 rdfa30 rdfa29 rdfa28 rdfa27 rdfa26 rdfa25 rdfa24 rdfa23 rdfa22 rdfa21 rdfa20 rdfa19 rdfa18 rdfa17 rdfa16 rdfa15 rdfa14 rdfa13 rdfa12 rdfa11 rdfa10 rdfa9 rdfa8 rdfa7 rdfa6 rdfa5 rdfa4 rdfa3 rdfa2 rdfa1 rdfa0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1133 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 e-dmac tbrar tbra31 tbra30 tbra29 tbra28 tbra27 tbra26 tbra25 tbra24 tbra23 tbra22 tbra21 tbra20 tbra19 tbra18 tbra17 tbra16 tbra15 tbra14 tbra13 tbra12 tbra11 tbra10 tbra9 tbra8 tbra7 tbra6 tbra5 tbra 4 tbra3 tbra2 tbra1 tbra0 tdfar tdfa31 tdfa30 tdfa29 tdfa28 tdfa27 tdfa26 tdfa25 tdfa24 tdfa23 tdfa22 tdfa21 tdfa20 tdfa19 tdfa18 tdfa17 tdfa16 tdfa15 tdfa14 tdfa13 tdfa12 tdfa11 tdfa10 tdfa9 tdfa8 tdfa7 tdfa6 tdfa5 tdfa4 tdfa3 tdfa2 tdfa1 tdfa0 csmr csebl csmd ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sb5 sb4 sb3 sb2 sb1 sb0 cssbm ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbm5 sbm4 sbm3 sbm2 sbm1 sbm0 cssmr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs15 cs14 cs13 cs12 cs11 cs10 cs9 cs8 cs7 cs6 cs5 cs4 cs3 cs2 cs1 cs0 a-dmac c0c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? c0c_r ? ? ? c0c_dwf ? ? ? c0c_vld ? ? ? c0c_eie ? ? ? c0c_e c0m ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? c0m_lie ? ? ? ?
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1134 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 a-dmac c0i ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? c0i_di ? ? ? c0i_li ? ? ? ? ? ? ? c0i_ei c0dsa c0dsa[31:24] c0dsa[23:16] c0dsa[15:8] c0dsa[7:0] c0dca c0dca[31:24] c0dca[23:16] c0dca[15:8] c0dca[7:0] c0d0 c0crdo[3:0] c0chdo[3:0] c0so[3:0] c0da c0sa c0csm[1:0] ? ? ? ? ? ? ? ? ? ? ? ? ? c0f[2:0] c0d1 c0d1[31:24] c0d1[23:16] c0d1[15:8] c0d1[7:0] c0d2 c0d2[31:24] c0d2[23:16] c0d2[15:8] c0d2[7:0] c0d3 ? ? c0dwe c0die ? ? ? ? ? ? ? ? ? ? ? ? c0d3[15:8] c0d3[7:0]
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1135 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 a-dmac c0d4 c0d4[31:24] c0d4[23:16] c0d4[15:8] c0d4[7:1] ? c1c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? c1c_r ? ? ? c1c_dwf ? ? ? c1c_vld ? ? ? c1c_eie ? ? ? c1c_e c1m ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? c1m_lie ? ? ? ? c1i ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? c1i_di ? ? ? c1i_li ? ? ? ? ? ? ? c1i_ei c1dsa c1dsa[31:24] c1dsa[23:16] c1dsa[15:8] c1dsa[7:0] c1dca c1dca[31:24] c1dca[23:16] c1dca[15:8] c1dca[7:0] c1d0 c1crdo[3:0] c1chdo[3:0] c1so[3:0] c1da c1sa c1csm[1:0] ? ? ? ? ? ? ? ? ? ? ? ? ? c1f[2:0]
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1136 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 a-dmac c1d1 c1d1[31:24] c1d1[23:16] c1d1[15:8] c1d1[7:0] c1d2 c1d2[31:24] c1d2[23:16] c1d2[15:8] c1d2[7:0] c1d3 ? ? c1dwe c1die ? ? ? ? ? ? ? ? ? ? ? ? c1d3[15:8] c1d3[7:0] c1d4 c1d4[31:24] c1d4[23:16] c1d4[15:8] c1d4[7:0] fecc ? ? ? fecc_r ? ? ? fecc_dwf ? ? ? fecc_dwe ? ? ? fecc_die ? ? ? fecc_lie ? ? ? fecc_nie ? ? ? fecc_eie ? ? ? fecc_e feci ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? feci_di ? ? ? feci_li ? ? ? feci_ni ? ? ? feci_ei fecdsa fecdsa[31:24] fecdsa[23:16] fecdsa[15:8] fecdsa[7:0]
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1137 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 a-dmac fecdca fecdca[31:24] fecdca[23:16] fecdca[15:8] fecdca[7:0] fecd00 fecd00_sz[15:8] fecd00_sz[7:0] fecd00_do[3:0] fecd00_so[3:0] fecd00_sn[3:0] fecd00_ dre fecd00_f[2:0] fecd01d0 a fecd01d0a[31:24] fecd01d0a[23:16] fecd01d0a[15:8] fecd01d0a[7:0] fecd02s0 a fecd02s0a[31:24] fecd02s0a[23:16] fecd02s0a[15:8] fecd02s0a[7:0] fecd03s1 a fecd03s1a[31:24] fecd03s1a[23:16] fecd03s1a[15:8] fecd03s1a[7:0] stif0 stmdr_0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? lsbsel edgsel clksel ckfrsel3 ckfrsel2 ckfrsel1 ckfrsel0 reqacsel vldactsel sycactsel iosel ifmdsel3 ifmdsel 2 ifmdsel1 ifmdsel0 stctlr_0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? rcvtm2 rcvtm1 rcvtm0 rcv trick ? ? ? ? reqen en srst
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1138 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 stif0 ? ? ? ? ? ? ? ? stcntcr _0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? crd cstp cset crst vlu31 vlu30 vlu29 vlu28 vlu27 vlu26 vlu25 vlu24 stcntvr _0 vlu23 vlu22 vlu21 vlu20 vlu19 vlu18 vlu17 vlu16 vlu15 vlu14 vlu13 vlu12 vlu11 vlu10 vlu9 vlu8 vlu7 vlu6 vlu5 vlu4 vlu3 vlu2 vlu1 vlu0 ststr_0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? lkzf lkf disf unzf pcrf tendf rendf rcvf3 rcvf2 rcvf1 upf opf ovf stier_0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? lkze lke dise unze pcre tende rende rcve3 rcve2 rcve1 upe ope ove size[31:24] stsizer_ 0 size[23:16] size[15:8] size[7:0] ? ? ? pid12 pid11 pi d10 pid9 pid8 stpwmm r_0 pid7 pid6 pid5 pid4 pid3 pid2 pid1 pid0 piden pwmuen pwmsel pwmsel2 pwmcyc[3:0] pwmsft[3:0] pwmdiv[3:0] ? ? ? ? ? ? ? ? stpwmc r_0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? stcxp pwmbrs pwmbwp pwmrs pw mwp stcrs stcwp pcrrs pcrwp
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1139 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 stif0 pwmb15 pwmb14 pwmb13 pwmb 12 pwmb11 pwmb10 pwmb9 pwmb8 stpwmr_ 0 pwmb7 pwmb6 pwmb5 pwmb4 pwmb3 pwmb2 pwmb1 pwmb0 pwm15 pwm14 pwm13 pwm 12 pwm11 pwm10 pwm9 pwm8 pwm7 pwm6 pwm5 pwm4 pwm3 pwm2 pwm1 pwm0 ? ? ? ? ? ? ? ? stpcr0r _0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? pcrb32 pcrb31 pcrb30 pcrb29 pcrb28 pcrb27 pcrb26 pcrb25 pcrb24 pcrb23 pcrb22 pcrb21 pcrb20 pcrb19 pcrb18 pcrb17 pcrb16 pcrb15 stpcr1r _0 pcrb14 pcrb13 pcrb12 pcrb11 pcrb10 pcrb9 pcrb8 pcrb7 pcrb6 pcrb5 pcrb4 pcrb3 pcrb2 pcrb1 pcrb0 pcrx8 pcrx7 pcrx6 pcrx5 pcrx4 pcrx3 pcrx2 pcrx1 pcrx0 ? ? ? ? ? ? ? ? ststc0r_ 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? stcb32 stcb31 stcb30 stcb29 stcb28 stcb27 stcb26 stcb25 stcb24 stcb23 stcb22 stcb21 stcb20 stcb19 stcb18 stcb17 stcb16 stcb15 ststc1r_ 0 stcb14 stcb13 stcb12 stcb11 stcb10 stcb9 stcb8 stcb7 stcb6 stcb5 stcb4 stcb 3 stcb2 stcb1 stcb0 stcx8 stcx7 stcx6 stcx5 stcx 4 stcx3 stcx2 stcx1 stcx0 stlkcr_0 ? ? ? ? ? ? lkwp ulwp ulcnt3 ulcnt2 ulcnt1 ul cnt0 lkcnt3 lkcnt2 lkcnt1 lkcnt0 gain3 gain2 gain1 gain0 lkcyc3 lkcyc2 lkcyc1 lkcyc0 ulref3 ulref2 ulre f1 ulref0 lkref3 lk ref2 lkref1 lkref0 stif1 stmdr_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? lsbsel edgsel clksel ckfrsel3 ckfrsel2 ckfrsel1 ckfrsel0 reqacsel vldactsel sycactsel iosel ifmdsel3 ifmdsel 2 ifmdsel1 ifmdsel0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1140 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 stif1 stctlr_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? rcvtm2 rcvtm1 rcvtm0 rcv trick ? ? ? ? reqen en srst ? ? ? ? ? ? ? ? stcntcr _1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? crd cstp cset crst vlu31 vlu30 vlu29 vlu28 vlu27 vlu26 vlu25 vlu24 stcntvr _1 vlu23 vlu22 vlu21 vlu20 vlu19 vlu18 vlu17 vlu16 vlu15 vlu14 vlu13 vlu12 vlu11 vlu10 vlu9 vlu8 vlu7 vlu6 vlu5 vlu4 vlu3 vlu2 vlu1 vlu0 ststr_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? lkzf lkf disf unzf pcrf tendf rendf rcvf3 rcvf2 rcvf1 upf opf owf stier_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? lkze lke dise unze pcre tende rende rcve3 rcve2 rcve1 upe ope owe size[31:24] stsizer_ 1 size[23:16] size[15:8] size[7:0] ? ? ? pid12 pid11 pi d10 pid9 pid8 stpwmmr_ 1 pid7 pid6 pid5 pid4 pid3 pid2 pid1 pid0 piden pwmuen pwmsel pwmsel2 pwmcyc[3:0] pwmsft[3:0] pwmdiv[3:0]
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1141 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 stif1 ? ? ? ? ? ? ? ? stpwmcr_ 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? stcxp pwmbrs pwmbwp pwmrs pw mwp stcrs stcwp pcrrs pcrwp pwmb15 pwmb14 pwmb13 pwmb12 pwmb11 pwmb10 pwmb9 pwmb8 stpwmr_ 1 pwmb7 pwmb6 pwmb5 pwmb4 pwmb3 pwmb2 pwmb1 pwmb0 pwm15 pwm14 pwm13 pwm 12 pwm11 pwm10 pwm9 pwm8 pwm7 pwm6 pwm5 pwm4 pwm3 pwm2 pwm1 pwm0 ? ? ? ? ? ? ? ? stpcr0r _1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? pcrb32 pcrb31 pcrb30 pcrb29 pcrb28 pcrb27 pcrb26 pcrb25 pcrb24 pcrb23 pcrb22 pcrb21 pcrb20 pcrb19 pcrb18 pcrb17 pcrb16 pcrb15 stpcr1r _1 pcrb14 pcrb13 pcrb12 pcrb11 pcrb10 pcrb9 pcrb8 pcrb7 pcrb6 pcrb5 pcrb4 pcrb3 pcrb2 pcrb1 pcrb0 pcrx8 pcrx7 pcrx6 pcrx5 pcrx4 pcrx3 pcrx2 pcrx1 pcrx0 ? ? ? ? ? ? ? ? ststc0r_ 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? stcb32 stcb31 stcb30 stcb29 stcb28 stcb27 stcb26 stcb25 stcb24 stcb23 stcb22 stcb21 stcb20 stcb19 stcb18 stcb17 stcb16 stcb15 ststc1r_ 1 stcb14 stcb13 stcb12 stcb11 stcb10 stcb9 stcb8 stcb7 stcb6 stcb5 stcb4 stcb 3 stcb2 stcb1 stcb0 stcx8 stcx7 stcx6 stcx5 stcx 4 stcx3 stcx2 stcx1 stcx0 stlkcr_1 ? ? ? ? ? ? lkwp ulwp ulcnt3 ulcnt2 ulcnt1 ul cnt0 lkcnt3 lkcnt2 lkcnt1 lkcnt0 gain3 gain2 gain1 gain0 lkcyc3 lkcyc2 lkcyc1 lkcyc0 ulref3 ulref2 ulre f1 ulref0 lkref3 lk ref2 lkref1 lkref0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1142 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 ssi scsr_0 ? ? ? ? ? ? ? ? ? ? ? ? ? ssi0cks2 ssi0cks1 ssi0cks0 scsr_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ssi1cks2 ssi1cks1 ssi1cks0 ssicr_0 ? ? ? dmen uien oien iien dien chnl1 chnl0 dwl2 dwl1 dwl0 swl2 swl1 swl0 sckd swsd sckp sw sp spdp sdta pdta del ? ckdv2 ckdv1 ckdv0 muen ? trmd en ssisr_0 ? ? ? dmrq uirq oirq iirq dirq ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? chno1 chno0 swno idst ssitdr_0 ssirdr_0 ssicr_1 ? ? ? dmen uien oien iien dien chnl1 chnl0 dwl2 dwl1 dwl0 swl2 swl1 swl0 sckd swsd sckp sw sp spdp sdta pdta del ? ckdv2 ckdv1 ckdv0 muen ? trmd en ssisr_1 ? ? ? dmrq uirq oirq iirq dirq ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? chno1 chno0 swno idst
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1143 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 ssi ssitdr_1 ssirdr_1 usb d0fwait ? ? ? ? ? ? ? ? ? ? ? ? fwait3 fwait2 fwait1 fwait0 d1fwait ? ? ? ? ? ? ? ? ? ? ? ? fwait3 fwait2 fwait1 fwait0 d0fifo fifoport[31:24] fifoport[23:16] fifoport[15:8] fifoport[7:0] d1fifo fifoport[31:24] fifoport[23:16] fifoport[15:8] fifoport[7:0] syscfg ? ? ? ? ? scke ? ? hse dcfm drpd dprpu ? ? ? usbe buswait ? ? ? ? ? ? ? ? ? ? ? ? bwait3 bwait2 bwait1 bwait0 syssts ? ? ? ? ? ? ? ? ? ? ? ? ? ? lnst1 lnst0 dvstctr ? ? ? ? ? ? ? wkup rwupe usbrst resume uact ? rhst2 rhst1 rhst0 testmode ? ? ? ? ? ? ? ? ? ? ? ? utst3 utst2 utst1 utst0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1144 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 usb d0fbcfg ? ? dfacc ? ? ? ? ? ? ? ? ? ? ? ? d1fbcfg ? ? dfacc ? ? ? ? ? ? ? ? ? ? ? ? cfifo fifoport[15:8] fifoport[7:0] cfifosel rcnt rew ? ? mbw1 mbw0 ? bigend ? ? isel ? curpipe3 curpipe2 curpipe1 curpipe0 cfifoctr bval bclr frdy ? dtln11 dtln10 dtln9 dtln8 dtln7 dtln6 dtln5 dtln 4 dtln3 dtln2 dtln1 dtln0 d0fifosel rcnt rew dclrm dreqe mbw1 mbw0 ? bigend ? ? ? ? curpipe3 curpipe2 curpipe1 curpipe0 d0fifoctr bval bclr frdy ? dtln11 dtln10 dtln9 dtln8 dtln7 dtln6 dtln5 dtln 4 dtln3 dtln2 dtln1 dtln0 d1fifosel rcnt rew dclrm dreqe mbw1 mbw0 ? bigend ? ? ? ? curpipe3 curpipe2 curpipe1 curpipe0 d1fifoctr bval bclr frdy ? dtln11 dtln10 dtln9 dtln8 dtln7 dtln6 dtln5 dtln 4 dtln3 dtln2 dtln1 dtln0 intenb0 vbse rsme sofe dvse ctre bempe nrdye brdye ? ? ? ? ? ? ? ? intenb1 ? bchge ? dtche attche ? ? eoferre ? ? signe sacke ? ? ? ? brdyenb ? ? ? ? ? ? pipe9 brdye pipe8 brdye pipe7 brdye pipe6 brdye pipe5 brdye pipe4 brdye pipe3 brdye pipe2 brdye pipe1 brdye pipe0 brdye nrdyenb ? ? ? ? ? ? pipe9 nrdye pipe8 nrdye pipe7 nrdye pipe6 nrdye pipe5 nrdye pipe4 nrdye pipe3 nrdye pipe2 nrdye pipe1 nrdye pipe0 nrdye
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1145 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 usb bempenb ? ? ? ? ? ? pipe9 bempe pipe8 bempe pipe7 bempe pipe6 bempe pipe5 bempe pipe4 bempe pipe3 bempe pipe2 bempe pipe1 bempe pipe0 bempe sofcfg ? ? ? ? ? ? ? trnensel ? brdym ? ? ? ? ? ? intsts0 vbint resm sofr dvst ctrt bemp nrdy brdy vbsts dvsq2 dvsq1 dvsq0 valid ctsq2 ctsq1 ctsq0 intsts1 ? bchg ? dtch attch ? ? ? ? eoferr sign sack ? ? ? ? brdysts ? ? ? ? ? ? pipe9 brdy pipe8 brdy pipe7 brdy pipe6 brdy pipe5 brdy pipe4 brdy pipe3 brdy pipe2 brdy pipe1 brdy pipe0 brdy nrdysts ? ? ? ? ? ? pipe9 nrdy pipe8 nrdy pipe7 nrdy pipe6 nrdy pipe5 nrdy pipe4 nrdy pipe3 nrdy pipe2 nrdy pipe1 nrdy pipe0 nrdy bempsts ? ? ? ? ? ? pipe9 bemp pipe8 bemp pipe7 bemp pipe6 bemp pipe5 bemp pipe4 bemp pipe3 bemp pipe2 bemp pipe1 bemp pipe0 bemp frmnum ovrn crce ? ? ? frnm[10:8] frnm[7:0] ufrmnum ? ? ? ? ? ? ? ? ? ? ? ? ? ufrnm[2:0] usbaddr ? ? ? ? ? ? ? ? ? usbaddr[6:0] usbreq brequest[7:0] bmrequesttype[7:0] usbval wvalue[15:8] wvalue[7:0]
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1146 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 usb usbindx windex[15:8] windex[7:0] usbleng wlength[15:8] wlength[7:0] dcpcfg ? ? ? ? ? ? ? ? ? ? ? dir ? ? ? ? dcpmaxp devsel3 devsel2 devsel1 devsel0 ? ? ? ? ? mxps6 mxps5 mxps4 m xps3 mxps2 mxps1 mxps0 dcpctr bsts sureq csclr cssts sureqclr ? ? sqclr sqset sqmon pbusy pinge ? ccpl pid1 pid0 pipesel ? ? ? ? ? ? ? ? ? ? ? ? pipesel3 pipesel2 pipesel1 pipesel0 pipecfg type1 type0 ? ? ? bfre dblb cntmd shtnak ? ? dir epnum3 epnum2 epnum1 epnum0 pipebuf ? bufsize[4:0] ? ? bufnmb[7:0] pipemaxp devsel[3:0] ? ? mxps[10:8] mxps[7:0] pipeperi ? ? ? ifis ? ? ? ? ? ? ? ? ? iitv2 iitv1 iitv0 pipe1ctr bsts inbufm csclr cssts ? atrepm aclrm sqclr sqset sqmon pbusy ? ? ? pid1 pid0 pipe2ctr bsts inbufm csclr cssts ? atrepm aclrm sqclr sqset sqmon pbusy ? ? ? pid1 pid0 pipe3ctr bsts inbufm csclr cssts ? atrepm aclrm sqclr sqset sqmon pbusy ? ? ? pid1 pid0 pipe4ctr bsts inbufm csclr cssts ? atrepm aclrm sqclr sqset sqmon pbusy ? ? ? pid1 pid0 pipe5ctr bsts inbufm csclr cssts ? atrepm aclrm sqclr sqset sqmon pbusy ? ? ? pid1 pid0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1147 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 usb pipe6ctr bsts ? csclr cssts ? ? aclrm sqclr sqset sqmon pbusy ? ? ? pid1 pid0 pipe7ctr bsts ? csclr cssts ? ? aclrm sqclr sqset sqmon pbusy ? ? ? pid1 pid0 pipe8ctr bsts ? csclr cssts ? ? aclrm sqclr sqset sqmon pbusy ? ? ? pid1 pid0 pipe9ctr bsts ? csclr cssts ? ? aclrm sqclr sqset sqmon pbusy ? ? ? pid1 pid0 pipe1tre ? ? ? ? ? ? trenb trclr ? ? ? ? ? ? ? ? pipe1trn trncnt[15:8] trncnt[7:0] pipe2tre ? ? ? ? ? ? trenb trclr ? ? ? ? ? ? ? ? pipe2trn trncnt[15:8] trncnt[7:0] pipe3tre ? ? ? ? ? ? trenb trclr ? ? ? ? ? ? ? ? pipe3trn trncnt[15:8] trncnt[7:0] pipe4tre ? ? ? ? ? ? trenb trclr ? ? ? ? ? ? ? ? pipe4trn trncnt[15:8] trncnt[7:0] pipe5tre ? ? ? ? ? ? trenb trclr ? ? ? ? ? ? ? ? pipe5trn trncnt[15:8] trncnt[7:0] devadd0 ? upphub[3:0] hubport[2:0] usbspd[1:0] ? ? ? ? ? ?
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1148 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 usb devadd1 ? upphub[3:0] hubport[2:0] usbspd[1:0] ? ? ? ? ? ? devadd2 ? upphub[3:0] hubport[2:0] usbspd[1:0] ? ? ? ? ? ? devadd3 ? upphub[3:0] hubport[2:0] usbspd[1:0] ? ? ? ? ? ? devadd4 ? upphub[3:0] hubport[2:0] usbspd[1:0] ? ? ? ? ? ? devadd5 ? upphub[3:0] hubport[2:0] usbspd[1:0] ? ? ? ? ? ? devadd6 ? upphub[3:0] hubport[2:0] usbspd[1:0] ? ? ? ? ? ? devadd7 ? upphub[3:0] hubport[2:0] usbspd[1:0] ? ? ? ? ? ? devadd8 ? upphub[3:0] hubport[2:0] usbspd[1:0] ? ? ? ? ? ? devadd9 ? upphub[3:0] hubport[2:0] usbspd[1:0] ? ? ? ? ? ? devadda ? upphub[3:0] hubport[2:0] usbspd[1:0] ? ? ? ? ? ? iic3 iccr1_0 ice rcvd mst trs cks3 cks2 cks1 cks0 iccr2_0 bbsy scp sdao sdaop sclo ? iirst ? icmr_0 mls ? ? ? bcwp bc2 bc1 bc0 icier_0 tie teie rie n akie stie acke ackbr ackbt icsr_0 tdre tend rdrf nackf stop al/ove aas adz sar_0 sva6 sva5 sva4 sva3 sva2 sva1 sva0 fs icdrt_0 icdrr_0 nf2cyc_0 ? ? ? ? ? ? prs nf2cyc
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1149 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 hif hifidx ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg5 reg4 reg3 reg2 reg1 reg0 byte1 byte0 hifgsr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? status15 status14 status13 status 12 status11 status10 status9 status8 status7 status6 status5 status 4 status3 status2 status1 status0 hifscr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dmd dpol bmd bsel ? ? md1 ? ? wbswp edn bo hifmcr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? lock ? wt ? rd ? ? ai/ad hifiicr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? iic6 iic5 iic4 iic3 iic2 iic1 iic0 iir hifeicr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? eic6 eic5 eic4 eic3 eic2 eic1 eic0 eir hifadr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? a9 a8 a7 a6 a5 a4 a3 a2 ? ?
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1150 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 hif hifdata d31 d30 d 29 d28 d27 d26 d25 d24 d23 d22 d21 d20 d19 d18 d17 d16 d15 d14 d13 d12 d11 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 hifdtr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dtrg hifbicr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bie bif hifbcr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ac cmt cmstr ? ? ? ? ? ? ? ? ? ? ? ? ? ? str1 str0 cmcsr_0 ? ? ? ? ? ? ? ? cmf cmie ? ? ? ? cks1 cks0 cmcnt_0 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 cmcor_0 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 cmcsr_1 ? ? ? ? ? ? ? ? cmf cmie ? ? ? ? cks1 cks0 cmcnt_1 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 cmcor_1 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1151 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 scif0 scsmr_0 ? ? ? ? ? ? ? ? c/ a chr pe o/ e stop ? cks1 cks0 scbrr_0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scscr_0 ? ? ? ? ? ? ? ? tie rie te re reie ? cke1 cke0 scftdr_ 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scfsr_0 per3 per2 per1 per0 fer3 fer2 fer1 fer0 er tend tdfe brk fer per rdf dr scfrdr_ 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scfcr_0 ? ? ? ? ? rstrg2 rstrg1 rstrg0 rtrg1 rtrg0 ttrg1 ttrg0 mce tfrst rfrst loop scfdr_0 ? ? ? t4 t3 t2 t1 t0 ? ? ? r4 r3 r2 r1 r0 ? ? ? ? ? ? ? ? scsptr_ 0 rtsio rtsdt ctsio ctsdt sckio sckdt spb2io spb2dt sclsr_0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? orer scif1 scsmr_1 ? ? ? ? ? ? ? ? c/ a chr pe o/ e stop ? cks1 cks0 scbrr_1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scscr_1 ? ? ? ? ? ? ? ? tie rie te re reie ? cke1 cke0 scftdr_ 1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scfsr_1 per3 per2 per1 per0 fer3 fer2 fer1 fer0 er tend tdfe brk fer per rdf dr scfrdr_ 1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scfcr_1 ? ? ? ? ? rstrg2 rstrg1 rstrg0 rtrg1 rtrg0 ttrg1 ttrg0 mce tfrst rfrst loop scfdr_1 ? ? ? t4 t3 t2 t1 t0 ? ? ? r4 r3 r2 r1 r0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1152 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 scif1 ? ? ? ? ? ? ? ? scsptr_ 1 rtsio rtsdt ctsio ctsdt sckio sckdt spb2io spb2dt sclsr_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? orer scif2 scsmr_2 ? ? ? ? ? ? ? ? c/ a chr pe o/ e stop ? cks1 cks0 scbrr_2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scscr_2 ? ? ? ? ? ? ? ? tie rie te re reie ? cke1 cke0 scftdr_ 2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scfsr_2 per3 per2 per1 per0 fer3 fer2 fer1 fer0 er tend tdfe brk fer per rdf dr scfrdr_ 2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scfcr_2 ? ? ? ? ? rstrg2 rstrg1 rstrg0 rtrg1 rtrg0 ttrg1 ttrg0 mce tfrst rfrst loop scfdr_2 ? ? ? t4 t3 t2 t1 t0 ? ? ? r4 r3 r2 r1 r0 ? ? ? ? ? ? ? ? scsptr_ 2 rtsio rtsdt ctsio ctsdt sckio sckdt spb2io spb2dt sclsr_2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? orer i/o padrh ? ? ? ? ? ? pa25dr pa24dr pa23dr pa22dr pa21dr pa20dr pa19dr pa18dr pa17dr ? paiorh ? ? ? ? ? ? pa25ior pa24ior pa23ior pa22ior pa21ior pa 20ior pa19ior pa18ior pa17ior ? pacrh2 ? ? ? ? ? ? ? ? ? ? ? ? ? pa25md0 ? pa24md0 pacrh1 ? pa23md0 ? pa22md0 ? pa21md0 ? pa20md0 ? pa19md0 ? pa18md0 ? pa17md0 ? ? pbdrl ? ? ? ? ? ? ? ? pb7dr pb6dr pb5dr pb4dr pb3dr pb2dr pb1dr pb0dr
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1153 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 i/o pbiorl ? ? ? ? ? ? ? ? pb7ior pb6ior pb5ior pb4ior pb3ior pb2ior pb1ior pb0ior pbcrl1 ? pb7md0 ? pb6md0 pb5md1 pb5md0 pb4md1 pb4md0 pb3md1 pb3md0 pb2md1 pb2md 0 pb1md1 pb1md0 pb0md1 pb0md0 pcdrh ? ? ? ? ? ? ? ? ? ? ? pc20dr pc19dr pc18dr pc17dr pc16dr pcdrl pc15dr pc14dr pc13dr pc 12dr pc11dr pc10dr pc9dr pc8dr pc7dr pc6dr pc5dr pc4dr pc3dr pc2dr pc1dr pc0dr pciorh ? ? ? ? ? ? ? ? ? ? ? pc20ior pc19ior pc18i or pc17ior pc16ior pciorl pc15ior pc14ior pc13ior pc12ior pc11ior pc10ior pc9ior pc8ior pc7ior pc6ior pc5i or pc4ior pc3ior pc 2ior pc1ior pc0ior pccrh1 ? ? ? ? ? ? ? pc20md0 ? pc19md0 ? pc18md0 ? pc17md0 ? pc16md0 pccrl2 ? pc15md0 ? pc14md0 ? pc13md0 ? pc12md0 ? pc11md0 ? pc10md0 ? pc9md0 ? pc8md0 pccrl1 ? pc7md0 ? pc6md0 ? pc5md0 ? pc4md0 ? pc3md0 ? pc2md0 ? pc1md0 ? pc0md0 pddrl ? ? ? ? ? ? ? ? pd7dr pd6dr pd5dr pd4dr pd3dr pd2dr pd1dr pd0dr pdiorl ? ? ? ? ? ? ? ? pd7ior pd6ior pd5i or pd4ior pd3ior pd 2ior pd1ior pd0ior pdcrl1 pd7md1 pd7md0 pd6md1 pd6m d0 pd5md1 pd5md0 pd4md1 pd4md0 pd3md1 pd3md0 pd2md1 pd2md0 pd1md1 pd1md0 pd0md1 pd0md0 pedrl ? ? ? ? pe11dr pe10dr pe9dr pe8dr pe7dr pe6dr pe5dr pe4dr pe3dr pe2dr pe1dr pe0dr peiorl ? ? ? ? pe11ior pe10ior pe9ior pe8ior pe7ior pe6ior pe5ior pe4ior pe3ior pe2ior pe1ior pe0ior pecrl2 ? ? ? ? pe13md1 pe13md0 pe12md1 pe12md0 pe11md1 pe11md0 pe10md1 pe10md0 pe09md1 pe09md0 pe08md1 pe08md0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1154 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 i/o pecrl1 pe07md1 pe07md0 pe06md1 pe06m d0 pe05md1 pe05md0 pe04md1 pe04md0 pe03md1 pe03md0 pe02md1 pe02md0 pe01md1 pe01md0 pe00md1 pe00md0 pfdrl ? ? ? ? pf11dr pf10dr pf9dr pf8dr pf7dr pf6dr pf5dr pf4dr pf3dr pf2dr pf1dr pf0dr pfiorl ? ? ? ? pf11ior pf10ior pf9ior pf8ior pf7ior pf6ior pf5i or pf4ior pf3ior pf 2ior pf1ior pf0ior pfcrl2 ? ? ? ? pf13md1 pf13md0 ? ? pf11md1 pf11md0 pf10md1 pf10md0 pf09md1 pf09md0 ? pf08md0 pfcrl1 pf07md1 pf07md0 pf06md1 pf06md0 pf05md1 pf05md0 pf04md1 pf04md0 pf03md1 pf03md0 pf02md1 pf02md0 pf01md1 pf01md0 ? pf00md0 pgdrh ? ? ? ? ? ? ? ? pg23dr pg22dr pg21dr pg20dr pg19dr pg18dr pg17dr pg16dr pgdrl pg15dr pg14dr pg13dr pg 12dr pg11dr pg10dr pg9dr pg8dr pg7dr pg6dr pg5dr pg4d r pg3dr pg2dr pg1dr pg0dr pgiorh ? ? ? ? ? ? ? ? pg23ior pg22ior pg21i or pg20ior pg19ior pg 18ior pg17ior pg16ior pgiorl pg15ior pg14ior pg13ior pg12i or pg11ior pg10ior pg9ior pg8ior pg7ior pg6ior pg5ior pg4ior pg3ior pg2ior pg1ior pg0ior pgcrh2 ? pg23md0 ? pg22md0 ? pg21md0 ? pg20md0 ? pg19md0 ? pg18md0 ? pg17md0 ? pg16md0 pgcrl2 ? pg15md0 ? pg14md0 ? pg13md0 ? pg12md0 ? pg11md0 ? pg10md0 ? pg09md0 ? pg08md0 pgcrl1 ? pg07md0 ? pg06md0 ? pg05md0 ? pg04md0 ? pg03md0 ? pg02md0 ? pg01md0 ? pg00md0 ubc bar_0 ba31 ba30 ba29 ba28 ba27 ba26 ba25 ba24 ba23 ba22 ba21 ba20 ba19 ba18 ba17 ba16 ba15 ba14 ba13 ba12 ba11 ba10 ba9 ba8 ba7 ba6 ba5 ba4 ba3 ba2 ba1 ba0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1155 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/6 29/21/13/5 28/ 20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 ubc bamr_0 bam31 bam30 bam29 bam28 bam27 bam26 bam25 bam24 bam23 bam22 bam21 bam20 bam19 bam18 bam17 bam16 bam15 bam14 bam13 bam 12 bam11 bam10 bam9 bam8 bam7 bam6 bam5 bam 4 bam3 bam2 bam1 bam0 bdr_0 bd31 bd30 bd29 bd 28 bd27 bd26 bd25 bd24 bd23 bd22 bd21 bd20 bd19 bd18 bd17 bd16 bd15 bd14 bd13 bd 12 bd11 bd10 bd9 bd8 bd7 bd6 bd5 bd 4 bd3 bd2 bd1 bd0 bdmr_0 bdm31 bdm30 bdm29 bd m28 bdm27 bdm26 bdm25 bdm24 bdm23 bdm22 bdm21 bdm 20 bdm19 bdm18 bdm17 bdm16 bdm15 bdm14 bdm13 bdm 12 bdm11 bdm10 bdm9 bdm8 bdm7 bdm6 bdm5 bdm4 bdm3 bdm2 bdm1 bdm0 bar_1 ba31 ba30 ba29 ba28 ba27 ba26 ba25 ba24 ba23 ba22 ba21 ba20 ba19 ba18 ba17 ba16 ba15 ba14 ba13 ba12 ba11 ba10 ba9 ba8 ba7 ba6 ba5 ba4 ba3 ba2 ba1 ba0 bamr_1 bam31 bam30 bam29 bam 28 bam27 bam26 bam25 bam24 bam23 bam22 bam21 bam20 bam19 bam18 bam17 bam16 bam15 bam14 bam13 bam 12 bam11 bam10 bam9 bam8 bam7 bam6 bam5 bam 4 bam3 bam2 bam1 bam0 bdr_1 bd31 bd30 bd29 bd 28 bd27 bd26 bd25 bd24 bd23 bd22 bd21 bd20 bd19 bd18 bd17 bd16 bd15 bd14 bd13 bd 12 bd11 bd10 bd9 bd8 bd7 bd6 bd5 bd 4 bd3 bd2 bd1 bd0 bdmr_1 bdm31 bdm30 bdm29 bd m28 bdm27 bdm26 bdm25 bdm24 bdm23 bdm22 bdm21 bdm 20 bdm19 bdm18 bdm17 bdm16 bdm15 bdm14 bdm13 bdm 12 bdm11 bdm10 bdm9 bdm8 bdm7 bdm6 bdm5 bdm4 bdm3 bdm2 bdm1 bdm0 bbr_0 ? ? ubid dbe cp3 cp2 cp1 cp0 cd1 cd0 id1 id0 rw1 rw0 sz1 sz0
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1156 of 1262 rej09b0437-0100 module name register 31/23/15/7 30/22/14/ 6 29/21/13/5 28/20/12/4 27/19/11/3 26/18/10/2 25/17/9/1 24/16/8/0 ubc bbr_1 ? ? ubid dbe cp3 cp2 cp1 cp0 cd1 cd0 id1 id0 rw1 rw0 sz1 sz0 brcr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? scmfc0 scmfc1 scmfd0 scmfd1 ? ? ? ? ? pcb1 pcb0 ? ? ? ? ? h-udi sdir ti7 ti6 ti5 ti4 ti3 ti2 ti1 ti0 ? ? ? ? ? ? ? ?
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1157 of 1262 rej09b0437-0100 28.3 register states in each operating mode module name register abbreviation address power-on reset software standby module standby sleep cache ccr1 h'fffc1000 initialized retained retained retained ccr2 h'fffc1004 initialized retained retained retained intc icr0 h'fffe0800 initialized * 1 retained ? * 3 retained icr1 h'fffe0802 initialized * 1 retained ? * 3 retained irqrr h'fffe0806 initialized retained ? * 3 retained ibcr h'fffe080c initialized retained ? * 3 retained ibnr h'fffe080e initialized retained ? * 3 retained ipr01 h'fffe0818 initialized retained ? * 3 retained ipr02 h'fffe081a initialized retained ? * 3 retained ipr06 h'fffe0c00 initialized retained ? * 3 retained ipr07 h'fffe0c02 initialized retained ? * 3 retained ipr08 h'fffe0c04 initialized retained ? * 3 retained ipr09 h'fffe0c06 initialized retained ? * 3 retained ipr10 h'fffe0c08 initialized retained ? * 3 retained ipr11 h'fffe0c0a initialized retained ? * 3 retained ipr12 h'fffe0c0c initialized retained ? * 3 retained ipr13 h'fffe0c0e initialized retained ? * 3 retained ipr14 h'fffe0c10 initialized retained ? * 3 retained ipr15 h'fffe0c12 initialized retained ? * 3 retained ipr16 h'fffe0c14 initialized retained ? * 3 retained bsc cmncr h'fffc0000 initialized * 1 retained ? * 3 retained cs0bcr h'fffc0004 initialized retained ? * 3 retained cs3bcr h'fffc0010 initialized retained ? * 3 retained cs4bcr h'fffc0014 initialized retained ? * 3 retained cs5bcr h'fffc0018 initialized retained ? * 3 retained cs6bcr h'fffc001c initialized retained ? * 3 retained cs0wcr h'fffc0028 initialized retained ? * 3 retained cs3wcr h'fffc0034 initialized retained ? * 3 retained cs4wcr h'fffc0038 initialized retained ? * 3 retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1158 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep bsc cs5wcr h'fffc003c initialized retained ? * 3 retained cs6wcr h'fffc0040 initialized retained ? * 3 retained sdcr h'fffc004c initialized retained ? * 3 retained rtcsr h'fffc0050 initialized retained ? * 3 retained rtcnt h'fffc0054 initialized retained ? * 3 retained rtcor h'fffc0058 initialized retained ? * 3 retained acswr h'fffc180c initialized retained retained retained ibmpr h'fffc1818 initialized retained retained retained ackeyr h'fffc1bfc initialized retained retained retained dmac sar_0 h'fffe1000 initialized retained retained retained dar_0 h'fffe1004 initialized retained retained retained dmatcr_0 h'fffe1008 initialized retained retained retained chcr_0 h'fffe100c initialized retained retained retained sar_1 h'fffe1010 initialized re tained retained retained dar_1 h'fffe1014 initialized retained retained retained dmatcr_1 h'fffe1018 initialized retained retained retained chcr_1 h'fffe101c initialized retained retained retained sar_2 h'fffe1020 initialized re tained retained retained dar_2 h'fffe1024 initialized retained retained retained dmatcr_2 h'fffe1028 initialized retained retained retained chcr_2 h'fffe102c initialized retained retained retained sar_3 h'fffe1030 initialized re tained retained retained dar_3 h'fffe1034 initialized retained retained retained dmatcr_3 h'fffe1038 initialized retained retained retained chcr_3 h'fffe103c initialized retained retained retained sar_4 h'fffe1040 initialized re tained retained retained dar_4 h'fffe1044 initialized retained retained retained dmatcr_4 h'fffe1048 initialized retained retained retained chcr_4 h'fffe104c initialized retained retained retained sar_5 h'fffe1050 initialized re tained retained retained dar_5 h'fffe1054 initialized retained retained retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1159 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep dmac dmatcr_5 h'fffe1058 initializ ed retained retained retained chcr_5 h'fffe105c initialized retained retained retained sar_6 h'fffe1060 initialized re tained retained retained dar_6 h'fffe1064 initialized retained retained retained dmatcr_6 h'fffe1068 initialized retained retained retained chcr_6 h'fffe106c initialized retained retained retained sar_7 h'fffe1070 initialized re tained retained retained dar_7 h'fffe1074 initialized retained retained retained dmatcr_7 h'fffe1078 initialized retained retained retained chcr_7 h'fffe107c initialized retained retained retained rsar_0 h'fffe1100 initialized retained retained retained rdar_0 h'fffe1104 initialized retained retained retained rdmatcr_0 h'fffe1108 initialized retained retained retained rsar_1 h'fffe1110 initialized retained retained retained rdar_1 h'fffe1114 initialized retained retained retained rdmatcr_1 h'fffe1118 initialized retained retained retained rsar_2 h'fffe1120 initialized retained retained retained rdar_2 h'fffe1124 initialized retained retained retained rdmatcr_2 h'fffe1128 initialized retained retained retained rsar_3 h'fffe1130 initialized retained retained retained rdar_3 h'fffe1134 initialized retained retained retained rdmatcr_3 h'fffe1138 initialized retained retained retained rsar_4 h'fffe1140 initialized retained retained retained rdar_4 h'fffe1144 initialized retained retained retained rdmatcr_4 h'fffe1148 initialized retained retained retained rsar_5 h'fffe1150 initialized retained retained retained rdar_5 h'fffe1154 initialized retained retained retained rdmatcr_5 h'fffe1158 initialized retained retained retained rsar_6 h'fffe1160 initialized retained retained retained rdar_6 h'fffe1164 initialized retained retained retained rdmatcr_6 h'fffe1168 initialized retained retained retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1160 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep dmac rsar_7 h'fffe1170 initializ ed retained retained retained rdar_7 h'fffe1174 initialized retained retained retained rdmatcr_7 h'fffe1178 initialized retained retained retained dmaor h'fffe1200 initialized retained retained retained dmars0 h'fffe1300 initialized retained retained retained dmars1 h'fffe1304 initialized retained retained retained dmars2 h'fffe1308 initialized retained retained retained dmars3 h'fffe130c initializ ed retained retained retained cpg frqcr h'fffe0010 initialized retained retained retained wdt wtcsr h'fffe0000 initialized * 2 retained ? * 3 retained wtcnt h'fffe0002 initialized * 2 retained ? * 3 retained wrcsr h'fffe0004 initialized * 2 retained ? * 3 retained stbcr h'fffe0014 initialized retained ? * 3 retained stbcr2 h'fffe0018 initialized retained ? * 3 retained power- down mode syscr1 h'fffe0402 initialized retained ? * 3 retained syscr2 h'fffe0404 initialized retained ? * 3 retained stbcr3 h'fffe0408 initialized retained ? * 3 retained stbcr4 h'fffe040c initialized retained ? * 3 retained syscr3 h'fffe0418 initialized retained ? * 3 retained etherc ecmr h'fffc2160 initializ ed retained retained retained ecsr h'fffc2164 initialized retained retained retained ecsipr h'fffc2168 initialized retained retained retained pir h'fffc216c initialized * 1 retained retained retained mahr h'fffc2170 initialized retained retained retained malr h'fffc2174 initialized retained retained retained rflr h'fffc2178 initialized retained retained retained psr h'fffc217c initialized * 1 retained retained retained trocr h'fffc2180 initialized retained retained retained cdcr h'fffc2184 initialized retained retained retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1161 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep etherc lccr h'fffc2188 initialized retained retained retained cndcr h'fffc218c initialized retained retained retained cefcr h'fffc2194 initialized retained retained retained frecr h'fffc2198 initialized retained retained retained tsfrcr h'fffc219c initialized retained retained retained tlfrcr h'fffc21a0 initialized retained retained retained rfcr h'fffc21a4 initialized retained retained retained mafcr h'fffc21a8 initialized retained retained retained ipgr h'fffc21b4 initialized retained retained retained apr h'fffc21b8 initialized retained retained retained mpr h'fffc21bc initialized retained retained retained tpauser h'fffc21c4 initializ ed retained retained retained e-dmac edmr h'fffc2000 initializ ed retained retained retained edtrr h'fffc2004 initialized retained retained retained edrrr h'fffc2008 initialized re tained retained retained tdlar h'fffc200c initialized retained retained retained rdlar h'fffc2010 initialized retained retained retained eesr h'fffc2014 initialized retained retained retained eesipr h'fffc2018 initialized retained retained retained trscer h'fffc201c initialized retained retained retained rmfcr h'fffc2020 initialized retained retained retained tftr h'fffc2024 initialized retained retained retained fdr h'fffc2028 initialized re tained retained retained rmcr h'fffc202c initialized retained retained retained edocr h'fffc2030 initialized retained retained retained fcftr h'fffc2034 initialized retained retained retained rpadir h'fffc2038 initialized retained retained retained trimd h'fffc203c initialized retained retained retained rbwar h'fffc2040 initialized retained retained retained rdfar h'fffc2044 initialized retained retained retained tbrar h'fffc204c initialized retained retained retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1162 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep e-dmac tdfar h'fffc2050 initializ ed retained retained retained csmr h'fffc20e4 initialized retained retained retained cssbm h'fffc20e8 initialized retained retained retained cssmr h'fffc20ec initialized retained retained retained a-dmac c0c h'fffc2440 initializ ed retained retained retained c0m h'fffc2444 initialized retained retained retained c0i h'fffc2448 initialized retained retained retained c0dsa h'fffc247c initialized retained retained retained c0dca h'fffc2480 initialized retained retained retained c0d0 h'fffc2484 initialized retained retained retained c0d1 h'fffc2488 initialized retained retained retained c0d2 h'fffc248c initialized retained retained retained c0d3 h'fffc2490 initialized retained retained retained c0d4 h'fffc2494 initialized retained retained retained c1c h'fffc24b0 initialized retained retained retained c1m h'fffc24b4 initialized retained retained retained c1i h'fffc24b8 initialized retained retained retained c1dsa h'fffc24ec initialized retained retained retained c1dca h'fffc24f0 initialized retained retained retained c1d0 h'fffc24f4 initialized retained retained retained c1d1 h'fffc24f8 initialized retained retained retained c1d2 h'fffc24fc initialized retained retained retained c1d3 h'fffc2500 initialized retained retained retained c1d4 h'fffc2504 initialized retained retained retained fecc h'fffc2590 initialized retained retained retained feci h'fffc2594 initialized retained retained retained fecdsa h'fffc2598 initialized retained retained retained fecdca h'fffc259c initialized retained retained retained fecd00 h'fffc25a0 initialized retained retained retained fecd01d0a h'fffc25a4 initializ ed retained retained retained fecd02s0a h'fffc25a8 initializ ed retained retained retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1163 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep a-dmac fecd03s1a h'fffc25ac init ialized retained re tained retained stif0 stmdr_0 h'ffffd000 initializ ed retained retained retained stctlr_0 h'ffffd004 initialized retained retained retained stcntcr_0 h'ffffd008 initialized retained retained retained stcntvr_0 h'ffffd00c initializ ed retained retained retained ststr_0 h'ffffd010 initialized retained retained retained stier_0 h'ffffd014 initialized retained retained retained stsizer_0 h'ffffd018 initializ ed retained retained retained stpwmmr_0 h'ffffd020 initialized retained retained retained stpwmcr_0 h'ffffd024 initializ ed retained retained retained stpwmr_0 h'ffffd028 initialized retained retained retained stpcr0r_0 h'ffffd02c initializ ed retained retained retained stpcr1r_0 h'ffffd030 initializ ed retained retained retained ststc0r_0 h'ffffd034 initializ ed retained retained retained ststc1r_0 h'ffffd038 initializ ed retained retained retained stlkcr_0 h'ffffd03c initializ ed retained retained retained stif1 stmdr_1 h'ffffd800 initializ ed retained retained retained stctlr_1 h'ffffd804 initialized retained retained retained stcntcr_1 h'ffffd808 initialized retained retained retained stcntvr_1 h'ffffd80c initializ ed retained retained retained ststr_1 h'ffffd810 initialized retained retained retained stier_1 h'ffffd814 initialized retained retained retained stsizer_1 h'ffffd818 initializ ed retained retained retained stpwmmr_1 h'ffffd820 initialized retained retained retained stpwmcr_1 h'ffffd824 initializ ed retained retained retained stpwmr_1 h'ffffd828 initialized retained retained retained stpcr0r_1 h'ffffd82c initializ ed retained retained retained stpcr1r_1 h'ffffd830 initializ ed retained retained retained ststc0r_1 h'ffffd834 initializ ed retained retained retained ststc1r_1 h'ffffd838 initializ ed retained retained retained stlkcr_1 h'ffffd83c initializ ed retained retained retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1164 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep ssi scsr_0 h'ffff0000 initialized retained retained retained scsr_1 h'ffff0800 initialized retained retained retained ssicr_0 h'ffffc000 in itialized retained retained retained ssisr_0 h'ffffc004 initialized retained retained retained ssitdr_0 h'ffffc008 initialized retained retained retained ssirdr_0 h'ffffc00c initialized retained retained retained ssicr_1 h'ffffc800 in itialized retained retained retained ssisr_1 h'ffffc804 initialized retained retained retained ssitdr_1 h'ffffc808 initialized retained retained retained ssirdr_1 h'ffffc80c initialized retained retained retained usb d0fwait h'fffc1c0c initia lized retained re tained retained d1fwait h'fffc1c0e initializ ed retained retained retained d0fifo h'fffc1c14 initializ ed retained retained retained d1fifo h'fffc1c18 initializ ed retained retained retained syscfg h'fffff800 initialized retained retained retained buswait h'fffff802 initializ ed retained retained retained syssts h'fffff804 initialized retained retained retained dvstctr h'fffff808 initializ ed retained retained retained testmode h'fffff80c initia lized retained re tained retained d0fbcfg h'fffff810 initializ ed retained retained retained d1fbcfg h'fffff812 initializ ed retained retained retained cfifo h'fffff814 initialized retained retained retained cfifosel h'fffff820 initializ ed retained retained retained cfifoctr h'fffff822 initializ ed retained retained retained d0fifosel h'fffff828 initializ ed retained retained retained d0fifoctr h'fffff82a initia lized retained re tained retained d1fifosel h'fffff82c initia lized retained re tained retained d1fifoctr h'fffff82e initia lized retained re tained retained intenb0 h'fffff830 initializ ed retained retained retained intenb1 h'fffff832 initializ ed retained retained retained brdyenb h'fffff836 initializ ed retained retained retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1165 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep usb nrdyenb h'fffff838 initializ ed retained retained retained bempenb h'fffff83a initializ ed retained retained retained sofcfg h'fffff83c initializ ed retained retained retained intsts0 h'fffff840 initializ ed retained retained retained intsts1 h'fffff842 initializ ed retained retained retained brdysts h'fffff846 initializ ed retained retained retained nrdysts h'fffff848 initialized retained retained retained bempsts h'fffff84a initializ ed retained retained retained frmnum h'fffff84c initializ ed retained retained retained ufrmnum h'fffff84e initializ ed retained retained retained usbaddr h'fffff850 initialized retained retained retained usbreq h'fffff854 initializ ed retained retained retained usbval h'fffff856 initialized retained retained retained usbindx h'fffff858 initializ ed retained retained retained usbleng h'fffff85a initializ ed retained retained retained dcpcfg h'fffff85c initializ ed retained retained retained dcpmaxp h'fffff85e initializ ed retained retained retained dcpctr h'fffff860 initialized retained retained retained pipesel h'fffff864 initialized retained retained retained pipecfg h'fffff868 initializ ed retained retained retained pipebuf h'fffff86a initializ ed retained retained retained pipemaxp h'fffff86c initializ ed retained retained retained pipeperi h'fffff86e initializ ed retained retained retained pipe1ctr h'fffff870 initializ ed retained retained retained pipe2ctr h'fffff872 initializ ed retained retained retained pipe3ctr h'fffff874 initializ ed retained retained retained pipe4ctr h'fffff876 initializ ed retained retained retained pipe5ctr h'fffff878 initializ ed retained retained retained pipe6ctr h'fffff87a initializ ed retained retained retained pipe7ctr h'fffff87c initializ ed retained retained retained pipe8ctr h'fffff87e initializ ed retained retained retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1166 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep usb pipe9ctr h'fffff880 initializ ed retained retained retained pipe1tre h'fffff890 initializ ed retained retained retained pipe1trn h'fffff892 initializ ed retained retained retained pipe2tre h'fffff894 initializ ed retained retained retained pipe2trn h'fffff896 initializ ed retained retained retained pipe3tre h'fffff898 initializ ed retained retained retained pipe3trn h'fffff89a initializ ed retained retained retained pipe4tre h'fffff89c initializ ed retained retained retained pipe4trn h'fffff89e initializ ed retained retained retained pipe5tre h'fffff8a0 initializ ed retained retained retained pipe5trn h'fffff8a2 initializ ed retained retained retained devadd0 h'fffff8d0 initializ ed retained retained retained devadd1 h'fffff8d2 initializ ed retained retained retained devadd2 h'fffff8d4 initializ ed retained retained retained devadd3 h'fffff8d6 initializ ed retained retained retained devadd4 h'fffff8d8 initializ ed retained retained retained devadd5 h'fffff8da initializ ed retained retained retained devadd6 h'fffff8dc initializ ed retained retained retained devadd7 h'fffff8de initializ ed retained retained retained devadd8 h'fffff8e0 initializ ed retained retained retained devadd9 h'fffff8e2 initializ ed retained retained retained devadda h'fffff8e4 initializ ed retained retained retained iic3 iccr1_0 h'fffee000 initializ ed retained retained retained iccr2_0 h'fffee001 initializ ed retained retained retained icmr_0 h'fffee002 initialized retained retained retained icier_0 h'fffee003 initializ ed retained retained retained icsr_0 h'fffee004 initialized retained retained retained sar_0 h'fffee005 initialized retained retained retained icdrt_0 h'fffee006 initialized retained retained retained icdrr_0 h'fffee007 initialized retained retained retained nf2cyc_0 h'fffee008 initializ ed retained retained retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1167 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep hif hifidx h'ffffe000 initializ ed retained retained retained hifgsr h'ffffe004 initialized retained retained retained hifscr h'ffffe008 initialized * 1 retained retained retained hifmcr h'ffffe00c initialized retained retained retained hifiicr h'ffffe010 initialized retained retained retained hifeicr h'ffffe014 initialized retained retained retained hifadr h'ffffe018 initialized retained retained retained hifdata h'ffffe01c initializ ed retained retained retained hifdtr h'ffffe020 initialized retained retained retained hifbicr h'ffffe024 initialized retained retained retained hifbcr h'ffffe040 initialized * 1 retained retained retained cmt cmstr h'fffec000 initialized initialized retained retained cmcsr_0 h'fffec002 initialized initialized retained retained cmcnt_0 h'fffec004 initialized initialized retained retained cmcor_0 h'fffec006 initialized initialized retained retained cmcsr_1 h'fffec008 initialized initialized retained retained cmcnt_1 h'fffec00a initialized initialized reta ined retained cmcor_1 h'fffec00c initializ ed initialized re tained retained scif0 scsmr_0 h'fffe8000 initializ ed retained retained retained scbrr_0 h'fffe8004 initialized retained retained retained scscr_0 h'fffe8008 initialized retained retained retained scftdr_0 h'fffe800c undefined retained retained retained scfsr_0 h'fffe8010 initialized retained retained retained scfrdr_0 h'fffe8014 undefined retained retained retained scfcr_0 h'fffe8018 initialized retained retained retained scfdr_0 h'fffe801c initializ ed retained retained retained scsptr_0 h'fffe8020 initialized * 1 retained retained retained sclsr_0 h'fffe8024 initialized retained retained retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1168 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep scif1 scsmr_1 h'fffe8800 initializ ed retained retained retained scbrr_1 h'fffe8804 initialized retained retained retained scscr_1 h'fffe8808 initialized retained retained retained scftdr_1 h'fffe880c undefined retained retained retained scfsr_1 h'fffe8810 initialized retained retained retained scfrdr_1 h'fffe8814 undefined retained retained retained scfcr_1 h'fffe8818 initialized retained retained retained scfdr_1 h'fffe881c initializ ed retained retained retained scsptr_1 h'fffe8820 initialized * 1 retained retained retained sclsr_1 h'fffe8824 initialized retained retained retained scif2 scsmr_2 h'fffe9000 initializ ed retained retained retained scbrr_2 h'fffe9004 initialized retained retained retained scscr_2 h'fffe9008 initialized retained retained retained scftdr_2 h'fffe900c undefined retained retained retained scfsr_2 h'fffe9010 initialized retained retained retained scfrdr_2 h'fffe9014 undefined retained retained retained scfcr_2 h'fffe9018 initialized retained retained retained scfdr_2 h'fffe901c initializ ed retained retained retained scsptr_2 h'fffe9020 initialized * 1 retained retained retained sclsr_2 h'fffe9024 initialized retained retained retained i/o padrh h'fffe3800 initialized retained ? * 3 retained paiorh h'fffe3804 initialized retained ? * 3 retained pacrh2 h'fffe3808 initialized retained ? * 3 retained pacrh1 h'fffe380a initialized retained ? * 3 retained pbdrl h'fffe3882 initialized retained ? * 3 retained pbiorl h'fffe3886 initialized retained ? * 3 retained pbcrl1 h'fffe388e initialized retained ? * 3 retained pcdrh h'fffe3900 initialized retained ? * 3 retained pcdrl h'fffe3902 initialized retained ? * 3 retained pciorh h'fffe3904 initialized retained ? * 3 retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1169 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep i/o pciorl h'fffe3906 initialized retained ? * 3 retained pccrh1 h'fffe390a initialized retained ? * 3 retained pccrl2 h'fffe390c initialized retained ? * 3 retained pccrl1 h'fffe390e initialized retained ? * 3 retained pddrl h'fffe3982 initialized retained ? * 3 retained pdiorl h'fffe3986 initialized retained ? * 3 retained pdcrl1 h'fffe398e initialized retained ? * 3 retained pedrl h'fffe3a02 initialized retained ? * 3 retained peiorl h'fffe3a06 initialized retained ? * 3 retained pecrl2 h'fffe3a0c initialized retained ? * 3 retained pecrl1 h'fffe3a0e initialized retained ? * 3 retained pfdrl h'fffe3a82 initialized retained ? * 3 retained pfiorl h'fffe3a86 initialized retained ? * 3 retained pfcrl2 h'fffe3a8c initialized retained ? * 3 retained pfcrl1 h'fffe3a8e initialized retained ? * 3 retained pgdrh h'fffe3b00 initialized retained ? * 3 retained pgdrl h'fffe3b02 initialized retained ? * 3 retained pgiorh h'fffe3b04 initialized retained ? * 3 retained pgiorl h'fffe3b06 initialized retained ? * 3 retained pgcrh2 h'fffe3b0a initialized retained ? * 3 retained pgcrl2 h'fffe3b0c initialized retained ? * 3 retained pgcrl1 h'fffe3b0e initialized retained ? * 3 retained ubc bar_0 h'fffc0400 initialized retained retained retained bamr_0 h'fffc0404 initialized retained retained retained bdr_0 h'fffc0408 initialized retained retained retained bdmr_0 h'fffc040c initialized retained retained retained bar_1 h'fffc0410 initialized retained retained retained bamr_1 h'fffc0414 initialized retained retained retained bdr_1 h'fffc0418 initialized retained retained retained bdmr_1 h'fffc041c initialized retained retained retained
section 28 list of registers rev. 1.00 nov. 14, 2007 page 1170 of 1262 rej09b0437-0100 module name register abbreviation address power-on reset software standby module standby sleep ubc bbr_0 h'fffc04a0 initialized retained retained retained bbr_1 h'fffc04b0 initialized retained retained retained brcr h'fffc04c0 initialized retained retained retained h-udi sdir h'fffe2000 retained retained retained retained notes: 1. there are bits that will not be initialized. 2. no initialization occurs if a wdt-based power-on reset is used. 3. this module provides no module standby function. 4. this is not a reset based on the power-on rese t pin, but it is initialization performed by applying the phy power supply.
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1171 of 1262 rej09b0437-0100 section 29 electrical characteristics 29.1 absolute maximum ratings table 29.1 lists the absolute maximum ratings. table 29.1 absolute maximum ratings item symbol value unit power supply voltage (i/o) v cc q ?0.3 to 4.6 v power supply voltage (internal) v cc ?0.3 to 1.7 v pll power supply voltage v cc (pll) ?0.3 to 1.7 v analog power supply voltage at the usb transceiver block (core) av33 ?0.3 to 4.6 v analog power supply voltage at the usb transceiver block (core) av12 ?0.3 to 1.7 v digital power supply voltage at the usb transceiver block (pins) dv33 ?0.3 to 4.6 v digital power supply voltage at the usb transceiver block (pins) dv12 ?0.3 to 1.7 v digital power supply voltage at the usb transceiver block (core) uv12 ?0.3 to 1.7 v input voltage v in ?0.3 to v cc q + 0.3 v operating temperature t opr ?20 to 70 (regular specifications) ?40 to 85 (wide temperature specifications) c storage temperature t stg ?55 to 125 c caution: permanent damage to the lsi may resu lt if absolute maximum ratings are exceeded.
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1172 of 1262 rej09b0437-0100 29.2 power-on/power-off sequence the sequences for turning on an d off power supplies are shown below together with recommended values. 3.3 v power supply 3.3 v power supply min. voltage 1.2 v power supply 1.2 v power supply min. voltage tunc tpwu tpwd gnd pins status undefined tunc pins status undefined normal operating period figure 29.1 power-on/power-off sequence table 29.2 recommended time for power-on/power-off sequence item symbol min. max. unit time difference in turning on 3.3 v to 1.2 v power supplies t pwu 0 ? ms time difference in turning off 1.2 v to 3.3 v power supplies t pwd 0 ? ms state undefined time t unc ? 100 ms note: the table shown above is recommended values , so they represent guidelines rather than strict requirements. the 3.3-v power supply (v cc q , , av33, and dv33) should be turned on before the 1.2-v power supply (v cc , v cc (pll) , av12, dv12, and uv12) is turned on. in addition, the 3.3-v power supply should be turned off after the 1. 2-v power supply is turned off. an undefined time appears until the 1.2-v power supply reaches above the minimum voltage and after it has reached below the minimum voltage. duri ng these periods, pin and internal states become undefined. design the system so that these undefined states do not cause an overall malfunction.
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1173 of 1262 rej09b0437-0100 29.3 dc characteristics table 29.3 lists dc characteristics. table 29.3 dc characteristics (1) [common items] conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, t a = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit test conditions v cc q 3.1 3.3 3.5 v power supply voltage v cc 1.1 1.2 1.3 v pll power supply voltage v cc (pll) 1.1 1.2 1.3 v av33 dv33 3.1 3.3 3.5 v usb power supply voltage av12 dv12 uv12 1.1 1.2 1.3 v v cc q i cc 0 ? 50 70 dv33 i cc 1 * 2 ? 44 65 v cc v cc (pll) i cc 2 ? 230 460 dv12 uv12 i cc 3 * 2 ? 32 55 av33 i cc 4 * 2 ? 4 5 normal operation av12 i cc 5 * 2 ? 14 16 ma values measured at maximum power supply voltages i = 200 mhz b = 100 mhz p = 50 mhz v cc q i sleep 0 ? 50 70 dv33 i sleep 1 * 2 ? 44 65 v cc v cc (pll) i sleep 2 ? 170 400 dv12 uv12 i sleep 3 * 2 ? 32 55 av33 i sleep 4 * 2 ? 4 5 supply current * 1 sleep mode av12 i sleep 5 * 2 ? 14 16 ma values measured at maximum power supply voltages i = 200 mhz b = 100 mhz p = 50 mhz
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1174 of 1262 rej09b0437-0100 item symbol min. typ. max. unit test conditions v cc q dv33 i sstby 00 ? 38 45 a v cc v cc (pll) dv12 uv12 i sstby 01 ? 250 280 ma av33 i sstby 02 ? 20 40 av12 i sstby 03 ? 2 5 a t a > 50c values measured at maximum power supply voltages v cc q dv33 i sstby 10 ? 35 42 a v cc v cc (pll) dv12 uv12 i sstby 11 ? 40 80 ma av33 i sstby 12 ? 20 40 supply current * 1 software standby mode av12 i sstby 13 ? 2 5 a t a 50c values measured at maximum power supply voltages all input pins (except pb7 to pb0) ? ? 1.0 a input leakage current pb01,pb00 |i in | ? ? 10 a v in = 0.5 to v cc q ? 0.5 v three-state leakage current all input/output pins, output pins |i sti | ? ? 1.0 a v in = 0.5 to v cc q ? 0.5 v pin capacitance all pins c in ? ? 15 pf notes: 1. supply current values are the val ues measured when all of the output pins and pins with the pull-up function are unloaded. 2. in usb operations.
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1175 of 1262 rej09b0437-0100 table 29.3 dc characteristics (2) [excluding the pins related to i 2 c and usb] conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, t a = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit test conditions extal, ckio, res , tck, trst , asemd , testmd , md_bw, md_ck1, md_ck0, nmi, st1_clkin/ssisck1, st1_vco_clkin/audio_clk, st0_clkin/ssisck0, st0_vco_clkin/audio_clk, st1_clkin/ssisck1, st1_vco_clkin/audio_clk, st0_clkin/ssisck0, st0_vco_clkin/audio_clk v cc q ? 0.3 ? v cc q + 0.3 v input high voltage input pins other than above (excluding pb0 to pb00) v ih 2.1 ? v cc q + 0.3 v extal, ckio, res , tck, trst , asemd , md_bw, md_ck1, md_ck0, nmi ?0.3 ? 0.3 v input low voltage input pins other than above (excluding pb0 to pb00) v il ?0.3 ? 0.8 v v ih v cc q ? 0.5 ? v cc q + 0.3 v port b input characteristics pb07, pb06, pb05/irq3, pb04/irq2, pb03/irq1/dreq1, pb02/irq0 v il ?0.3 ? 0.5 v output high voltage v oh 2.4 ? ? v i oh = ?200 a output low voltage v ol ? ? 0.4 v i ol = 1.6 ma
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1176 of 1262 rej09b0437-0100 table 29.3 dc characteristics (3) [pins related to i 2 c*] conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit test conditions input high voltage v ih v cc q ? 0.5 ? v cc q + 0.3 v input low voltage v il ?0.3 ? 0.5 v schmitt trigger input characteristics v ih ? v il v cc q 0.05 ? ? v output low voltage v ol ? ? v cc q 0.2 v i ol = 3.0 ma note: * referring to the pb01/ iois16 /scl and pb00/ wait /sda pins (open-drain pins) table 29.3 dc characteristics (4) [pins related to usb*] conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, t a = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit test conditions reference resistance r ref 5.6 ? 1% 5.6 5.6 + 1% k ? input high voltage (vbus) v ih 4.0 ? 5.5 v input low voltage (vbus) v il ?0.3 ? 1.0 v input high voltage (usb_x1) v ih v cc q ? 0.3 ? v cc q + 0.3 v input low voltage (usb_x1) v il ?0.3 ? 0.3 v note: * referring to the refrin, vbus, usb_x1, and usb_x2 pins
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1177 of 1262 rej09b0437-0100 table 29.3 dc characteristics (5) [pins related to usb* (low-speed/full-speed/hig h-speed common items)] conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit test conditions 0.900 ? 1.575 k ? in idle mode dp pull-up resistance (when the function is selected) r pu 1.425 ? 3.090 k ? in transmit/receive mode dp/dm pull-down resistance (when the host is selected) r pd 14.25 ? 24.80 k ? note: * referring to the dp and dm pins
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1178 of 1262 rej09b0437-0100 table 29.3 dc characteristics (6) [pins related to usb* (for low-speed/full speed)] conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit test conditions input high voltage v ih 2.0 ? ? v input low voltage v il ? ? 0.8 v differential input sensitivity v di 0.2 ? ? v | (dp) ? (dm) | differential common mode range v cm 0.8 ? 2.5 v output high voltage v oh 2.8 ? ? v i oh = ?200 a output low voltage v ih ? ? 0.3 v i ol = 2.0 ma single-ended receiver threshold voltage v se 0.8 ? 2.0 v output signal crossover voltage range v ors 1.3 ? 2.0 v c l = 50 pf note: * referring to the dp and dm pins
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1179 of 1262 rej09b0437-0100 table 29.3 dc characteristics (7) [pins related to usb* (for high speed)] conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit test conditions squelch-detected threshold voltage (differential voltage) v hssq 100 ? 150 mv common mode voltage range v hscm ?50 ? 500 mv idle state v hsoi ?10.0 ? 10.0 mv output high voltage v hsoh 360 ? 440 mv output low voltage v hsol ?10.0 ? 10.0 mv chirp j output voltage (differential) v chirpj 700 ? 1100 mv chirp k output voltage (differential) v chirpk ?900 ? ?500 mv note: * referring to the dp and dm pins
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1180 of 1262 rej09b0437-0100 table 29.4 permissible output currents conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit pins related to ic 2 * 10 ma permissible output low current (per pin) output pins other than above i ol ? ? 2 ma permissible output low current (total) i ol ? ? 60 ma permissible output high current (per pin) -i oh ? ? 2 ma permissible output high current (total) -i oh ? ? 60 ma note: * when use the pb01/ iois16 /scl and pb00/ wait /sda pins as scl and sda. caution: to protect the lsi's re liability, do not exceed the output current values in table 29.4. 29.4 ac characteristics signals input to this lsi are basically handled as signals in synchronization with a clock. the setup and hold times for input pins must be followed. table 29.5 maximum operating frequency conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit remarks cpu (i ) 60 ? 200 mhz internal bus, external bus (b ) 60 ? 100 mhz operating frequency peripheral module (p ) f 10 ? 50 mhz
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1181 of 1262 rej09b0437-0100 29.4.1 clock timing table 29.6 clock timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure extal clock input frequency f ex 15 25 mhz extal clock input cycle time t excyc 40 66.6 ns audio_clk clock input frequency f ex 10 40 mhz audio_clk clock in put cycle time t excyc 25 100 ns usb_x1 clock input frequency f ex 48 48 mhz extal/audio_clk clock input low-level pulse width t exl 0.4 0.6 t excyc 29.2
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1182 of 1262 rej09b0437-0100 item symbol min. max. unit figure extal/audio_clk clock input high-level pulse width t exh 0.4 0.6 t excyc extal/audio_clk clock input rise time t exr ? 4 ns extal/ssi_clk clock input fall time t exf ? 4 ns 29.2 ckio clock input frequency f ck 60 100 mhz ckio clock input cycle time t ckicyc 10 16.6 ns ckio clock input low-level pulse width t ckil 0.3 0.7 t ckicyc ckio clock input high-level pulse width t ckih 0.3 0.7 t ckicyc ckio clock input rise time t ckir ? 2 ns ckio clock input fall time t ckif ? 2 ns 29.3 ckio clock output frequency f op 60 100 mhz ckio clock output cycle time t cyc 10 16.6 ns ckio clock output low-level pulse width t ckol 2 ? ns ckio clock output high-level pulse width t ckoh 2 ? ns 29.4 ckio clock output rise time t ckor ? 3 ns ckio clock output fall time t ckof ? 3 ns 29.4 power-on oscillation settling time t osc1 10 ? ms 29.5 oscillation settling time on return from standby 1 t osc2 10 ? ms 29.6 oscillation settling time on return from standby 2 t osc3 10 ? ms 29.7 t exh t exf t exr t exl t excyc v ih v ih v ih 1/2 vccq 1/2 vccq v il v il extal, audio_clk, usb_x1 * (input) note: * when the clock is input on the extal, audio_clk, or usb_x1 pin figure 29.2 extal, audio_clk, and usb_x1 clock input timing
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1183 of 1262 rej09b0437-0100 t ckih t ckif t ckir t ckil t ckicyc v ih v ih v ih 1/2 vccq 1/2 vccq v il v il ckio (input) figure 29.3 ckio clock input timing t cyc t ckol t ckoh v oh 1/2 vccq 1/2 vccq ckio (output) t ckor t ckof v oh v ol v ol v oh figure 29.4 ckio clock output timing vcc min. t osc1 vcc res ckio internal clock oscillation settling time note: oscillation settling time when the internal oscillator is used figure 29.5 power-on oscillation settling time
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1184 of 1262 rej09b0437-0100 ckio internal clock oscillation settling time standby period t osc2 res note: oscillation settling time when the internal oscillator is used figure 29.6 oscillation settling time on return from standby (return by reset) ckio internal clock oscillation settling time standby period t osc3 nmi, irq note: oscillation settling time when the internal oscillator is used figure 29.7 oscillation settling time on re turn from standby (return by nmi or irq)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1185 of 1262 rej09b0437-0100 29.4.2 control signal timing table 29.7 control signal timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) b = 66.67 mhz item symbol min. max. unit figure res pulse width t resw 20 * 1 ? t cyc * 3 29.8 nmi pulse width t nmiw 20 * 2 ? t cyc * 3 irq pulse width t irqw 20 * 2 ? t cyc * 3 29.9 notes: 1. in standby mode or when the clock multiplication ratio is changed, t resw = t osc2 (10 ms). 2. in standby mode, t nmiw /t irqw = t osc3 (10 ms). 3. t bcyc indicates the external bus clock (b ) cycle. res t resw figure 29.8 reset input timing nmi t nmiw t irqw irq7 to irq0 figure 29.9 interrupt signal input timing
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1186 of 1262 rej09b0437-0100 29.4.3 bus timing table 29.8 bus timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure a25 to a17, a0 1 10.3 ns address delay time 1 a16 to a1 t ad1 1 8.3 ns 29.10 to 29.36 address setup time t as 0 ? ns 29.10 to 29.13 address hold time t ah 0 ? ns 29.10 to 29.13 bs delay time t bsd ? 8.3 ns 29.10 to 29.29, 29.33 to 29.36 cs delay time 1 t csd1 1 8.3 ns 29.10 to 29.36 read/write delay time 1 t rwd1 1 8.3 ns 29.10 to 29.36 read strobe delay time t rsd 1/2t bcyc 1/2t bcyc + 8.3 ns 29.10 to 29.15, 29.33, 29.34 read data setup time 1 t rds1 1/2t bcyc + 10 ? ns 29.10 to 29.13, 29.14, 29.15, 29.33 to 29.36 read data setup time 2 t rds2 4.3 ? ns 29.16 to 29.19, 29.24 to 29.26 read data hold time 1 t rdh1 0 ? ns 29.10 to 29.13, 29.33 to 29.36 read data hold time 2 t rdh2 2 ? ns 29.16 to 29.19, 29.24 to 29.26 write enable delay time 1 t wed1 1/2t bcyc 1/2t bcyc + 8.3 ns 29.10 to 29.13, 29.33, 29.34 write enable delay time 2 t wed2 ? 8.3 ns 29.15
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1187 of 1262 rej09b0437-0100 item symbol min. max. unit figure write data delay time 1 t wdd1 ? 10 ns 29.10 to 29.15, 29.33 to 29.36 write data delay time 2 t wdd2 ? 8.3 ns 29.20 to 29.23, 29.27 to 29.29 write data hold time 1 t wdh1 1 ? ns 29.10 to 29.15, 29.33 to 29.36 write data hold time 2 t wdh2 1 ? ns 29.20 to 29.23, 29.27 to 29.29 write data hold time 4 t wdh4 0 ? ns 29.10, 29.33, 29.35 wait setup time t wts 1/2t bcyc + 12 ? ns 29.11 to 29.15, 29.34, 29.36 wait hold time t wth 1/2t bcyc + 5 ? ns 29.11 to 29.15, 29.34, 29.36 iois16 setup time t io16s 1/2t bcyc + 12 ? ns 29.36 iois16 hold time t io16h 1/2t bcyc + 5 ? ns 29.36 ras delay time 1 t rasd1 1 8.3 ns 29.16 to 29.32 cas delay time 1 t casd1 1 8.3 ns 29.16 to 29.32 dqm delay time 1 t dqmd1 1 8.3 ns 29.16 to 29.29 cke delay time 1 t cked1 1 8.3 ns 29.31 dack, tend delay time t dacd ? refer to dmac module timing. ns 29.10 to 29.29, 29.33 to 29.36 iciord delay time t icrsd 1/2t bcyc 1/2t bcyc + 8.3 ns 29.35, 29.36 iciowr delay time t icwsd 1/2t bcyc 1/2t bcyc + 8.3 ns 29.35, 29.36 note: t bcyc indicates the external bus clock (b ) cycle.
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1188 of 1262 rej09b0437-0100 t1 t ad1 t as t csd1 t2 t ad1 t rwd1 t rwd1 t csd1 t rsd t rsd t ah t rdh1 t rds1 t wed1 t wed1 t ah t bsd t bsd t dacd t dacd t wdh4 t wdd1 ckio a25 to a0 csn rd/ wr rd d31 to d0 read wen bs dackn tendn * note: * the waveforms for dackn and tendn are produced when the active low state is specified. d31 to d0 write t wdh1 figure 29.10 basic bus timing for normal space (no wait)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1189 of 1262 rej09b0437-0100 t1 t ad1 t as t csd1 tw t2 t ad1 t rwd1 t rwd1 t csd1 t rsd t rsd t ah t rds1 t wed1 t wed1 t ah t bsd t bsd t wth t wts t dacd t dacd t wdh1 t wdd1 ckio a25 to a0 csn rd/ wr rd d31 to d0 read wen bs wait dackn tendn * note: * the waveforms for dackn and tendn are produced when the active low state is specified. d31 to d0 write t rdh1 figure 29.11 basic bus timing for no rmal space (one so ftware wait cycle)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1190 of 1262 rej09b0437-0100 t1 t ad1 t as t csd1 tw x t2 t ad1 t rwd1 t rwd1 t csd1 t rsd t rsd t ah t rds1 t wed1 t wed1 t ah t bsd t bsd t wth t wts t wth t wts t dacd t dacd t wdh1 t wdd1 ckio a25 to a0 csn rd/ wr rd d31 to d0 read wen bs wait dackn tendn * note: * the waveforms for dackn and tendn are produced when the active low state is specified. d31 to d0 write t rdh1 figure 29.12 basic bus timing for norm al space (one ext ernal wait cycle)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1191 of 1262 rej09b0437-0100 t ad1 t ad1 t1 t rwd1 t rsd t wed1 t wed1 t wed1 t rds1 t rds1 t as t rsd t rsd t ah t rsd t ah t wed1 t ah t ah t csd1 t wdd1 t wdh1 t wdh1 t wdd1 t bsd t bsd t dacd t dacd t dacd t dacd t bsd t bsd t rwd1 t rwd1 t rwd1 t csd1 t csd1 t csd1 t as t ad1 t ad1 tw t2 ta w t1 tw t2 ta w dackn tendn * note: * the waveforms for dackn and tendn are produced when the active low state is specified. a25 to a0 d31 to d0 csn rd/ wr rd wait d31 to d0 we n bs ckio t wth t wts t wth t wts t rdh1 t rdh1 read write figure 29.13 basic bus timing for normal space (one software wait cycle, external wait enabled (wm bit = 0), no idle cycle)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1192 of 1262 rej09b0437-0100 th t ad1 t rsd t rsd t rds1 t csd1 t rwd1 t1 twx t2 tf t wdd1 t bsd t wdh1 t rdh1 t ad1 t csd1 ckio a25 to a0 csn wen rd d31 to d0 d31 to d0 read rd/ wr rd/ wr bs wait dackn tendn * note: * the waveforms for dackn and tendn are produced when the active low state is specified. write t dacd t dacd t bsd t wts t wts t rwd1 t rwd1 t rwd1 t wed1 t wed1 t wth t wth figure 29.14 sram bus cycle with byte se lection (sw = one cycle, hw = one cycle, one asynchronous external wait cycle, bas = 0 (write cycle ub/lb control))
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1193 of 1262 rej09b0437-0100 th t ad1 t rsd t rsd t rds1 t csd1 t1 twx t2 tf t rwd1 t wdd1 t bsd t rwd1 t rwd1 t wdh1 t rdh1 t ad1 t csd1 ckio a25 to a0 csn wen rd d31 to d0 d31 to d0 read rd/ wr rd/ wr bs wait dackn tendn * note: * the waveforms for dackn and tendn are produced when the active low state is specified. write t dacd t dacd t bsd t wts t wts t wed2 t wed2 t rwd1 t wth t wth figure 29.15 sram bus cycle with byte se lection (sw = one cycle, hw = one cycle, one asynchronous external wait cycle, bas = 1 (write cycle we control))
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1194 of 1262 rej09b0437-0100 tc1 tr tcw td1 tde t ad1 t ad1 t csd1 t ad1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 t rdh2 t rds2 ckio a25 to a0 csn rd/ wr a12/a11 * 1 notes: 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. d31 to d0 t rasd1 t rasd1 ras row address reada command column address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 figure 29.16 synchronous dram single-read bus cycle (auto-precharged, cas latency 2, wtrcd = zero cycle, wtrp = zero cycle)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1195 of 1262 rej09b0437-0100 tr w tr tc1 tcw td1 tde tap t ad1 t ad1 t csd1 t ad1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 t rdh2 t rds2 ckio a25 to a0 csn rd/ wr a12/a11 * 1 notes: 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. d31 to d0 t rasd1 t rasd1 ras row address reada command column address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 figure 29.17 synchronous dram single-read bus cycle (auto-precharged, cas latency 2, wtrc d = one cycle, wtrp = one cycle)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1196 of 1262 rej09b0437-0100 tc1 tc2 td1 td2 td3 td4 tr tc3 tc4 tde t ad1 t ad1 t csd1 t ad1 t ad1 t ad1 t ad1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 t ad1 t rdh2 t rds2 ckio a25 to a0 csn rd/ wr a12/a11 * 1 notes: 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. d31 to d0 t rasd1 t rasd1 ras row address reada command read command column address (1 to 4) t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 t rdh2 t rds2 figure 29.18 synchronous dram burst-read bus cycle (equivalent to four read cycles) (auto-precharged, cas latency 2, wtrc d = zero cycle, wtrp = one cycle)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1197 of 1262 rej09b0437-0100 tc1 tc2 td1 td2 td3 td4 tr tr w t c 3 t c 4 t d e t ad1 t ad1 t csd1 t ad1 t ad1 t ad1 t ad1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 t ad1 t rdh2 t rds2 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 t rasd1 t rasd1 ras row address read command column address (1 to 4) t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 t rdh2 t rds2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. reada command notes: figure 29.19 synchronous dram burst-read bus cycle (equivalent to four read cycles) (auto-precharged, cas latency 2, wtrc d = one cycle, wtrp = zero cycle)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1198 of 1262 rej09b0437-0100 trwl tr tc1 t ad1 t csd1 t ad1 t ad1 t rwd1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 t rasd1 t rasd1 ras row address writa command column address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 t wdh2 t wdd2 notes: 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. figure 29.20 synchronous d ram single-write bus cycle (auto-precharged, trwl = one cycle)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1199 of 1262 rej09b0437-0100 trw tc1 trwl tr tr w t ad1 t csd1 t ad1 t ad1 t rwd1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 t rasd1 t rasd1 ras row address writa command column address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 t wdh2 t wdd2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. notes: figure 29.21 synchronous d ram single-write bus cycle (auto-precharged, wtrcd = two cycles, trwl = one cycle)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1200 of 1262 rej09b0437-0100 tc2 tc3 tc4 trwl tr tc1 t ad1 t csd1 t ad1 t ad1 t ad1 t ad1 t ad1 t rwd1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 t rasd1 t rasd1 ras row address writa command writ command column address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 t wdh2 t wdd2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. t wdh2 t wdd2 notes: figure 29.22 synchronous d ram burst-write bus cycle (equivalent to four write cycles) (auto-precharged, wtrcd = zero cycle, trwl = one cycle)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1201 of 1262 rej09b0437-0100 tc2 tc3 tc4 trwl tr tc1 tr w t ad1 t csd1 t ad1 t ad1 t ad1 t ad1 t ad1 t rwd1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 t rasd1 t rasd1 ras row address writa command writ command column address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 t wdh2 t wdd2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. t wdh2 t wdd2 notes: figure 29.23 synchronous d ram burst-write bus cycle (equivalent to four write cycles) (auto-precharged, wtrcd = one cycle, trwl = one cycle)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1202 of 1262 rej09b0437-0100 tc3 tc4 tde tr tc2 td1 td2 td3 td4 tc1 t csd1 t ad1 t ad1 t ad1 t ad1 t ad1 t ad1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 t rasd1 t rasd1 ras row address read command column address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. t rdh2 t rds2 t rdh2 t rds2 notes: figure 29.24 synchronous dram burst-read bus cycle (equivalent to four read cycles) (bank active mode: act+read commands, cas latency 2, wtrcd = zero cycle)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1203 of 1262 rej09b0437-0100 tc2 tc4 tde tc1 tc3 td1 td2 td3 td4 t csd1 t ad1 t ad1 t ad1 t rwd1 t rwd1 t csd1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 t rasd1 ras read command column address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. t rdh2 t rds2 t rdh2 t rds2 notes: figure 29.25 synchronous dram burst-read bus cycle (equivalent to four read cycles) (bank active mode: read command, sa me row address, cas latency 2, wtrcd = zero cycle)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1204 of 1262 rej09b0437-0100 tc3 tc4 tde tc2 td1 td2 td3 td4 tc1 tr tr w tp t csd1 t ad1 t ad1 t ad1 t ad1 t ad1 t ad1 t rwd1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 t rasd1 t rasd1 t rasd1 t rasd1 ras read command column address row address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. t rdh2 t rds2 t rdh2 t rds2 notes: figure 29.26 synchronous dram burst-read bus cycle (equivalent to four read cycles) (bank active mode: pre+act+read co mmands, different ro w addresses, cas latency 2, wtrcd = zero cycle)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1205 of 1262 rej09b0437-0100 tc2 tc3 tc4 tr tc1 t ad1 t csd1 t ad1 t ad1 t ad1 t ad1 t ad1 t rwd1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 t rasd1 t rasd1 ras row address writ command column address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 t wdh2 t wdd2 notes: t wdh2 t wdd2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. figure 29.27 synchronous dram burs t-write bus cycle (equivalent to four write cycles) (bank active mode: act +write commands, wtrcd = zero cycle, trwl = zero cycle)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1206 of 1262 rej09b0437-0100 tc2 tc3 tc4 tnop tc1 t ad1 t csd1 t ad1 t ad1 t ad1 t ad1 t rwd1 t rwd1 t rwd1 t csd1 t ad1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 ras writ command column address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 t wdh2 t wdd2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. t wdh2 t wdd2 notes: figure 29.28 synchronous dram burs t-write bus cycle (equivalent to four write cycles) (bank active mode: write command, same row address, wtrcd = zero cycle, trwl = zero cycle)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1207 of 1262 rej09b0437-0100 tc2 tc3 tc4 tr tpw tp tc1 t ad1 t csd1 t ad1 t ad1 t ad1 t rwd1 t rwd1 t rwd1 t rwd1 t csd1 t rasd1 t rasd1 t rasd1 t rasd1 t ad1 t ad1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 ras writ command row address t ad1 t ad1 column address t casd1 t casd1 cas t bsd t bsd (high) bs cke t dqmd1 t dqmd1 dqmxx t dacd t dacd dackn tendn * 2 t wdh2 t wdd2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. t wdh2 t wdd2 notes: figure 29.29 synchronous dram burs t-write bus cycle (equivalent to four write cycles) (bank active mode: pre+act+write commands, different row addresses, wtrcd = zero cycle, trwl = zero cycle)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1208 of 1262 rej09b0437-0100 tr c tr c tr r tpw tp tr c t csd1 t ad1 t ad1 t rwd1 t rwd1 t rwd1 t csd1 t csd1 t csd1 t rasd1 t rasd1 t rasd1 t rasd1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 ras t casd1 t casd1 cas (high) (hi-z) bs cke dqmxx dackn tendn * 2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. notes: figure 29.30 synchronous d ram auto-refreshing timing (wtrp = one cycle, wtrc = three cycles)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1209 of 1262 rej09b0437-0100 tr c tr c tr c tr r tpw tp t csd1 t ad1 t ad1 t rwd1 t rwd1 t rwd1 t csd1 t csd1 t csd1 t rasd1 t rasd1 t rasd1 t rasd1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 ras t casd1 t casd1 cas (hi-z) bs cke dqmxx dackn tendn * 2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. t cked1 t cked1 notes: figure 29.31 synchronous dram self-r efreshing timing (wtrp = one cycle)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1210 of 1262 rej09b0437-0100 trc trc trc tmw tde tr r tr r tpw tp tr c t csd1 t ad1 t ad1 t ad1 pall ref ref mrs t rwd1 t rwd1 t rwd1 t csd1 t csd1 t csd1 t rasd1 t rasd1 t rasd1 t rasd1 t ad1 t ad1 ckio a25 to a0 csn rd/ wr a12/a11 * 1 d31 to d0 ras t casd1 t casd1 cas (hi-z) bs cke dqmxx dackn tendn * 2 1. address pin to be connected to a10 of sdram 2. the waveforms for dackn and tendn are produced when the active low state is specified. t csd1 t csd1 t rasd1 t rasd1 t casd1 t casd1 t csd1 t csd1 t rwd1 t rwd1 t rasd1 t rasd1 t casd1 t casd1 notes: figure 29.32 synchronous dram mode re gister write timing (wtrp = one cycle)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1211 of 1262 rej09b0437-0100 note: * the waveforms for dackn and tendn are produced when the active low state is specified. ckio a25 to a0 cexx rd/ wr rd d15 to d0 we d15 to d0 bs read write t ad1 t csd1 t ad1 t csd1 t rwd1 t wdh4 t bsd t dacd t bsd dackn tendn * t dacd t rdh1 tpcm1w tpcm2 tpcm1 tpcm1w tpcm1w t rsd t rds1 t wed1 t rwd1 t wdd1 t rsd t wed1 t wdh1 figure 29.33 pcmcia me mory card bus cycle (ted = zero cycle, teh = zero cycle, no wait)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1212 of 1262 rej09b0437-0100 ckio a25 to a0 cexx rd/ wr rd d15 to d0 we d15 to d0 bs read write wait t wts t ad1 t csd1 t rwd1 t ad1 t csd1 t rwd1 t bsd t bsd note: * the waveforms for dackn and tendn are produced when the active low state is specified. dackn tendn * t dacd t dacd t wdh1 t wdd1 t wed1 t wed1 t rsd t rsd t rdh1 t rds1 t wth t wth t wts tpcm1w tpcm2 tpcm0 tpcm1 tpcm1w tpcm0w tpcm2w tpcm1w tpcm1w figure 29.34 pcmcia memory card bus cycle (ted = two cycles, teh = one cycl e, zero software wait cycle, one hardware wait cycle)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1213 of 1262 rej09b0437-0100 note: * the waveforms for dackn and tendn are produced when the active low state is specified. ckio a25 to a0 cexx rd/ wr iciord d15 to d0 iciowr d15 to d0 bs read write t ad1 t csd1 t rwd1 t ad1 t csd1 t rwd1 t wdd1 t wdh4 t bsd t dacd t bsd dackn tendn * t dacd t icrsd t icwsd t icwsd t rdh1 tpcm1w tpcm2 tpcm1 tpcm1w tpcm1w t rds1 t icrsd t wdh1 figure 29.35 pcmcia i/o card bus cycle (ted = zero cycle, teh = zero cycle, no wait)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1214 of 1262 rej09b0437-0100 ckio a25 to a0 cexx rd/ wr iciord d15 to d0 iciowr d15 to d0 bs read write wait t wts t ad1 t csd1 t rwd1 t ad1 t csd1 t rwd1 t bsd t bsd note: * the waveforms for dackn and tendn are produced when the active low state is specified. dackn tendn * t dacd t dacd t wdh1 t wdd1 t icwsd t icwsd t icrsd t icrsd t rdh1 t rds1 t wth t wth t wts iois16 tpcm1w tpcm2 tpcm0 tpcm1 tpcm1w tpcm0w tpcm2w tpcm1w tpcm1w t io16h t io16s figure 29.36 pcmcia i/o card bus cycle (ted = two cycles, teh = one cycl e, zero software wait cycle, one hardware wait cycle)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1215 of 1262 rej09b0437-0100 29.4.4 dmac module timing table 29.9 dmac module timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure dreq setup time t drqs 10 ? dreq hold time t drqh 10 ? 29.37 dack, tend delay time t dacd ? 10 ns 29.38 t drqs t drqh ckio dreqn note: n = 0, 1 figure 29.37 dreq input timing note: n = 0, 1 ckio tendn dackn t dacd t dacd figure 29.38 dack, tend output timing
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1216 of 1262 rej09b0437-0100 29.4.5 watchdog timer timing table 29.10 shows the timing of the watchdog timer. table 29.10 watchdog timer timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure wdtovf delay time t wovd ? 100 ns 29.39 t wovd t wovd ckio wdtovf figure 29.39 watchdog timer timing
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1217 of 1262 rej09b0437-0100 29.4.6 scif module timing table 29.11 scif module timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure clocked synchronous 12 ? t pcyc 29.40 input clock cycle asynchronous t scyc 4 ? t pcyc 29.40 input clock rise time t sckr ? 1.5 t pcyc 29.40 input clock fall time t sckf ? 1.5 t pcyc 29.40 input clock width t sckw 0.4 0.6 t scyc 29.40 transmit data delay time (clocked synchronous) t txd ? 3 t pcyc +15 t pcyc 29.41 receive data setup time (clocked synchronous) t rxs 4 t pcyc +15 ? ns 29.41 receive data hold time (clocked synchronous) t rxh 100 ? ns 29.41 note: t pcyc indicates the peripheral clock (p ) cycle. t sckw t sckr t sckf t scyc sck figure 29.40 sck input clock timing
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1218 of 1262 rej09b0437-0100 t scyc t txd sck (input/output) txd (data transmit) rxd (data receive) t rxh t rxs figure 29.41 scif input/output timing in clocked synchronous mode
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1219 of 1262 rej09b0437-0100 29.4.7 iic3 mo dule timing table 29.12 i 2 c bus interface 3 timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) values item symbol test conditions min. typ. max. unit figure scl input cycle time t scl 12 t pcyc * 1 + 600 ? ? ns scl input high pulse width t sclh 3 t pcyc * 1 + 300 ? ? ns scl input low pulse width t scll 5 t pcyc * 1 + 300 ? ? ns scl, sda input rise time t sr ? ? 300 ns scl, sda input fall time t sf ? ? 300 ns scl, sda input spike pulse removal time * 2 t sp ? ? 1, 2 t pcyc * 1 sda input bus free time t buf 5 ? ? t pcyc * 1 start condition input hold time t stah 3 ? ? t pcyc * 1 retransmit start condition input setup time t stas 3 ? ? t pcyc * 1 stop condition input setup time t stos 3 ? ? t pcyc * 1 data input setup time t sdas 1 t pcyc * 1 + 20 ? ? ns data input hold time t sdah 0 ? ? ns scl, sda capacitive load cb 0 ? 100 pf scl, sda output fall time * 3 t sf v cc q = 3.1 to 3.5 v ? ? 250 ns 29.42 notes: 1. t pcyc indicates the peripheral clock (p ) cycle. 2. depends on the value of nf2cyc. 3. indicates the i/o buffer characteristics.
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1220 of 1262 rej09b0437-0100 scl v ih v il t stah t buf p * s * t sf t sr t scl t sdah t sclh t scll sda sr * t stas t sp t stos t sdas p * [legend] s: start condition p: stop condition sr: start condition for retransmission figure 29.42 i 2 c bus interface 3 input/output timing
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1221 of 1262 rej09b0437-0100 29.4.8 ssi module timing table 29.13 ssi module timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit remarks figure output clock cycle t o 80 ? 6400 ns output input clock cycle t i 80 ? 6400 ns input clock high t hc 32 ? ? ns clock low t lc 32 ? ? ns bidirectional clock rise time t rc ? ? 20 ns output (100 pf) 29.43 delay t dtr ?5 ? 25 ns transmit 29.44, 29.45 input setup time t sr 25 ? ? ns receive 29.46, 29.47 input hold time t htr 5 ? ? ns receive 29.46 to 29.47 audio_clk input frequency f audio 10 ? 40 mhz 29.48 t i ,t o t hc ssisckn t lc t rc figure 29.43 clock input/output timing
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1222 of 1262 rej09b0437-0100 t dtr t htr ssisckn ssiwsn, ssidatan figure 29.44 ssi transmit timing (1) t dtr t htr ssisckn ssiwsn, ssidatan figure 29.45 ssi transmit timing (2) t sr t htr ssisckn ssiwsn, ssidatan figure 29.46 ssi receive timing (1) t sr t htr ssisckn ssiwsn, ssidatan figure 29.47 ssi receive timing (2)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1223 of 1262 rej09b0437-0100 f audio audio_clk figure 29.48 audio_clk input timing
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1224 of 1262 rej09b0437-0100 29.4.9 usb transceiver timing table 29.14 usb transceiv er timing (for full speed) conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit figure rise time t fr 4 ? 20 ns fall time t ff 4 ? 20 ns rise/fall time ratio t fr /t ff 70 ? 130 % 29.49 dp, dm t fr t ff 10% 10% 90% 90% figure 29.49 dp/dm output timing (for full speed) circuit under measurement dv33 dp dm dg33 c l 50pf c l 50pf the value of electrostatic capacitance (cl) includes the stray capacitance of the connection and the input capacitance of the probe. figure 29.50 measurement circuit (for full speed)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1225 of 1262 rej09b0437-0100 table 29.15 usb transceiver timing (for low speed) conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. typ. max. unit figure rise time t lr 75 ? 300 ns fall time t lf 75 ? 300 ns 29.51 output driver resistance t lr /t lf 80 ? 125 % dp, dm t hsr t hsf 10% 10% 90% 90% figure 29.51 dp/dm outp ut timing (for low speed) circuit under measurement dv33 dp dm dg33 r l 45 ? r l 45 ? figure 29.52 measurement circuit (for low speed)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1226 of 1262 rej09b0437-0100 29.4.10 sdhi module timing table 29.16 sdhi module timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure (p > 33.3 mhz) 4 ? sdhiclk clock cycle (p 33.3 mhz) t sdpp 2 ? t pcyc sdhiclk clock high width t sdwh 0.4 ? t sdpp sdhiclk clock low width t sdwl 0.4 ? t sdpp sdhicmd, sdhid3 to sdhid0 output data delay (data transfer mode) t sdodly ? 14 ns sdhicmd, sdhid3 to sdhid0 input data setup time t sdisu 12 ? ns sdhicmd, sdhid3 to sdhid0 input data hold t sdih 12 ? ns 29.53 note: t pcyc is a cycle of peripheral clock (p ). t sdpp t sdwl t sdih t sdisu t sdodly (max) t sdodly (min) t sdwh sdhiclk sdhicmd, sdhid3 to sdhid0 input sdhicmd,sdhid3 to sdhid0 output figure 29.53 sd card interface
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1227 of 1262 rej09b0437-0100 29.4.11 i/o port timing table 29.17 i/o port timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure output data delay time t portd ? 100 input data setup time t ports 100 ? input data hold time t porth 100 ? ns 29.55 t ports ckio port (read) port (write) t porth t portd figure 29.54 i/o port timing
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1228 of 1262 rej09b0437-0100 29.4.12 hif module signal timing table 29.18 hif module signal timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure read bus cycle time t hifcycr 5.0 ? t pcyc write bus cycle time t hifcycw 5.0 ? t pcyc read low width (in reading) t hifwrl 3.0 ? t pcyc write low width (in writing) t hifwwl 3.0 ? t pcyc read/write high width t hifwrwh 2.0 ? t pcyc read data delay time t hifrdd ? 2 t pcyc + 16 ns read data hold time t hifrdh 0 ? ns write data setup time t hifwds t pcyc + 10 ? ns write data hold time t hifwdh 10 ? ns 29.55 hifint output delay time t hifitd ? 20 ns 29.56 hifrdy output delay time t hifryd ? 20 t pcyc 29.57 hifdreq output delay time t hifdqd ? 20 ns 29.56 hif pin enable delay time t hifebd ? 20 ns 29.57 hif pin disable delay time t hifdbd ? 20 ns 29.57 notes: 1. t pcyc indicates the peripheral clock (p ) cycle. 2. the t hifwrl period is specified as the over lap between the low period of the hifcs signal and the low period of the hifrd signal. 3. the t hifwwl period is specified as the overla p between the low period of the hifcs signal and the low period of the hifwr signal. 4. the t hifwrwh (min) is equal to 2 t pcyc + 5 ns when writing into the hif index register (hifidx) is followed by reading fr om the registers reg5 to reg0.
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1229 of 1262 rej09b0437-0100 hifrs hifcs hifrd hifwr hifd15 to hifd00 t hifwrl t hifcycr t hifcycw t hifwwl t hifwrwh t hifwds t hifrdh t hifrdd t hifwdh read data write data figure 29.55 hif access timing ckio hifint hifdreq t hifdqd t hifitd figure 29.56 hifint /hifdreq timing
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1230 of 1262 rej09b0437-0100 t hifdbd t hifryd t hifryd t hifebd hifd15 to hifd0 hifebl hifint res hifdreq hifrdy hifrdy figure 29.57 hifrdy/hif pin enable/disable timing
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1231 of 1262 rej09b0437-0100 29.4.13 etherc module signal timing table 29.19 etherc module signal timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure tx-clk cycle time t tcyc 40 ? ns ? tx-en output delay time t tend 1 20 ns mii_txd[3:0] output delay time t mtdd 1 20 ns crs setup time t crss 10 ? ns crs hold time t crsh 10 ? ns 29.58 col setup time t cols 10 ? ns col hold time t colh 10 ? ns 29.59 rx-clk cycle time t rcyc 40 ? ns ? rx-dv setup time t rdvs 10 ? ns rx-dv hold time t rdvh 10 ? ns mii_rxd[3:0] setup time t mrds 10 ? ns mii_rxd[3:0] hold time t mrdh 10 ? ns 29.60 rx-er setup time t rers 10 ? ns rx-er hold time t rerh 10 ? ns 29.61 mdio setup time t mdios 10 ? ns mdio hold time t mdioh 10 ? ns 29.62 mdio output data hold time * t mdiodh 5 18 ns 29.63 wol output delay time t wold 1 20 ns 29.64 exout output delay time t exoutd 1 20 ns 29.65 note: * operate the internal register (pir) in ph y block to meet the requirement of this specification.
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1232 of 1262 rej09b0437-0100 t crss t crsh t tend t etdd tx-clk tx-en mii_txd[3:0] tx-er crs col data sfd crc preamble figure 29.58 mii transmit timing (during normal operation) t colh t cols tx-clk tx-en mii_txd[3:0] tx-er crs col jam preamble figure 29.59 mii transmit timing (in the event of a collision)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1233 of 1262 rej09b0437-0100 t rdvs t rdvh t erdh t erds rx-clk rx-dv mii_rxd[3:0] rx-er data sfd crc preamble figure 29.60 mii receive timi ng (during normal operation) t rers t rerh rx-clk rx-dv mii_rxd[3:0] rx-er data sfd xxxx preamble figure 29.61 mii receive timing (in the event of a collision) mdc mdio t mdios t mdioh figure 29.62 mdio input timing mdc mdio t mdiodh figure 29.63 mdio output timing
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1234 of 1262 rej09b0437-0100 rx-clk wol t wold figure 29.64 wol output timing ckio exout t exoutd figure 29.65 exout output timing
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1235 of 1262 rej09b0437-0100 29.4.14 h-udi related pin timing table 29.20 h-udi related pin timing conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure tck cycle time t tckcyc 50 * ? ns tck high pulse width t tckh 0.4 0.6 t tckcyc tck low pulse width t tckl 0.4 0.6 t tckcyc 29.66 tdi setup time t tdis 10 ? ns tdi hold time t tdih 10 ? ns tms setup time t tmss 10 ? ns tms hold time t tmsh 10 ? ns tdo delay time t tdod ? 16 ns 29.67 note: * this should be greater than the cycle time for the peripheral clock (p ). t tckcyc v ih 1/2 vccq 1/2 vccq v ih v il v il v ih t tckl t tckh figure 29.66 tck input timing
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1236 of 1262 rej09b0437-0100 tck tms tdi tdo tdo change timing after the switching command is set initial value t tdis t tdih t tckcyc t tmss t tmsh t tdod t tdod figure 29.67 h-udi data transfer timing
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1237 of 1262 rej09b0437-0100 29.4.15 stif module signal timing (1) table 29.21 stif modul e signal timing (1) conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure parallel mode 2 24 stn_clkin clock input cycle serial mode t st_ckin_cyc 1.25 24 t bcyc * parallel mode 0.4 0.6 stn_clkin clock input high pulse width serial mode t st_ckin_h 0.4 0.6 t st_ckin_cyc parallel mode 0.4 0.6 stn_clkin clock input low pulse width serial mode t st_ckin_l 04 0.6 t st_ckin_cyc parallel mode ? 2.75 stn_clkin clock input rise time serial mode t st_ckin_r ? 1.75 ns parallel mode ? 2.75 stn_clkin clock input fall time serial mode t st_ckin_f ? 1.75 ns 29.68 note: * t bcyc indicates the external bus clock (b ) cycle. t st_ckin_cyc v ih 1/2 v cc q 1/2 v cc q v ih v ih v il v ih v il v il stn_clkin input v il t st_ckin_l t st_ckin_f t st_ckin_f t st_ckin_r t st_ckin_r t st_ckin_h t st_ckin_h figure 29.68 stif mo dule signal timing (1)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1238 of 1262 rej09b0437-0100 29.4.16 stif module signal timing (2) table 29.22 stif modul e signal timing (2) conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure parallel mode 2 24 st_clkout clock output cycle serial mode t st_ckout_cyc 1 24 t bcyc * parallel mode 6.75 ? st_clkout clock output high pulse width serial mode t st_ckout_h 3 ? ns parallel mode 6.75 ? st_clkout clock output low pulse width serial mode t st_ckout_l 3 ? ns parallel mode ? 2.75 st_clkout clock output rise time serial mode t st_ckout_r ? 2.75 ns parallel mode ? 2.75 st_clkout clock output fall time serial mode t st_ckout_f ? 2.75 ns 29.69 note: * t bcyc indicates the external bus clock (b ) cycle. t ts_ckout_cyc v ih v ih v ih v il v ih v il v il st_clkout output v il t st_ckout_l t st_ckout_f t st_ckout_f t st_ckout_r t st_ckout_r t st_ckout_h t st_ckout_h 1/2 v cc q 1/2 v cc q figure 29.69 stif mo dule signal timing (2)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1239 of 1262 rej09b0437-0100 29.4.17 stif module signal timing (3) (with stream input/output set synchr onized with stn_clkin rise time) table 29.23 stif modul e signal timing (3) conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure stn_syc output delay time 1 t stsd1 ? 11 ns stn_vld output delay time 1 t stvd1 ? 11 ns stn_req output delay time 1 t strd1 ? 11 ns stn_dm output delay time 1 t stdd1 ? 11 ns stn_syc input setup time 1 t stss1 4 ? ns stn_syc input hold time 1 t stsh1 6 ? ns stn_vld input setup time 1 t stvs1 4 ? ns stn_vld input hold time 1 t stvh1 6 ? ns stn_req input setup time 1 t strs1 4 ? ns stn_req input hold time 1 t strh1 6 ? ns stn_dm input setup time 1 t stds1 4 ? ns stn_dm input hold time 1 t stdh1 6 ? ns 29.70
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1240 of 1262 rej09b0437-0100 stn_clkin input stn_syc output stn_vld output stn_d7 - stn_d0 output stn_syc input stn_vld input stn_d7 - stn_d0 input t stvd1 t stsd1 t stdd1 t stvd1 t stsd1 t stdd1 t stss1 t stvs1 t stds1 t stsh1 t stvh1 t stdh1 t stss1 t stvs1 t stds1 t stsh1 t stvh1 t stdh1 stn_req input t strs1 t strh1 t strs1 t strh1 figure 29.70 stif mo dule signal timing (3)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1241 of 1262 rej09b0437-0100 29.4.18 stif module signal timing (4) (with stream input/output set synchr onized with stn_clkin fall time) table 29.24 stif modul e signal timing (4) conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure stn_syc output delay time 2 t stsd2 ? 11 ns stn_vld output delay time 2 t stvd2 ? 11 ns stn_req output delay time 2 t strd2 ? 11 ns stn_dm output delay time 2 t stdd2 ? 11 ns stn_syc input setup time 2 t stss2 4 ? ns stn_syc input hold time 2 t stsh2 6 ? ns stn_vld input setup time 2 t stvs2 4 ? ns stn_vld input hold time 2 t stvh2 6 ? ns stn_req input setup time 2 t strs2 4 ? ns stn_req input hold time 2 t strh2 6 ? ns stn_dm input setup time 2 t stds2 4 ? ns stn_dm input hold time 2 t stdh2 6 ? ns 29.71
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1242 of 1262 rej09b0437-0100 t stvd2 t stsd2 t stdd2 t stvd2 t stsd2 t stdd2 t stss2 t stvs2 t stds2 t stsh2 t stvh2 t stdh2 t stss2 t stvs2 t stds2 t stsh2 t stvh2 t stdh2 t strs2 t strh2 t strs2 t strh2 stn_clkin input stn_syc output stn_vld output stn_d7 - stn_d0 output stn_syc input stn_vld input stn_d7 - stn_d0 input stn_req input figure 29.71 stif mo dule signal timing (4)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1243 of 1262 rej09b0437-0100 29.4.19 stif module signal timing (5) (with stream output set synchroni zed with stn_clkout rise time) table 29.25 stif modul e signal timing (5) conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure stn_syc output delay time 5 t stsd5 ? 5 ns stn_vld output delay time 5 t stvd5 ? 5 ns stn_dm output delay time 5 t stdd5 ? 5 ns stn_req input setup time 5 t strs5 9.5 ? ns stn_req input hold time 5 t strh5 9.5 ? ns 29.72 stn_req input t strh6 t strs6 t strh6 t strs6 st_clkout output stn_syc output stn_vld output stn_d7 - stn_d0 output t stvd6 t stsd6 t stdd6 t stvd6 t stsd6 t stdd6 figure 29.72 stif mo dule signal timing (5)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1244 of 1262 rej09b0437-0100 29.4.20 stif module signal timing (6) (with stream output set synchroni zed with stn_clkout fall time) table 29.26 stif modul e signal timing (6) conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure stn_syc output delay time 6 t stsd6 ? 5 ns stn_vld output delay time 6 t stvd6 ? 5 ns stn_dm output delay time 6 t stdd6 ? 5 ns stn_req input setup time 6 t strs6 9.5 ? ns stn_req input hold time 6 t strh6 9.5 ? ns 29.73 st_clkout output stn_syc output stn_vld output stn_d7 to stn_d0 output t stvd6 t stsd6 t stdd6 t stvd6 t stsd6 t stdd6 stn_req input t strh6 t strs6 t strh6 t strs6 figure 29.73 stif mo dule signal timing (6)
section 29 electrical characteristics rev. 1.00 nov. 14, 2007 page 1245 of 1262 rej09b0437-0100 29.4.21 stif module signal timing (7) table 29.27 stif modul e signal timing (7) conditions: v cc = v cc (pll) = dv12 = uv12 = 1.1 to 1.3 v, v cc q = dv33 = 3.1 to 3.5 v, av12 = 1.1 to 1.3 v, av33 = 3.1 to 3.5 v, v ss = v ss (pll) = dg12 = ug12 = v ss q = dg33 = ag12 = ag33 = 0 v, ta = ?20 to 70c (regular specifications), ?40 to 85c (wide temperature specifications) item symbol min. max. unit figure stn_pwm output delay time t stpwd ? 15 ns 29.74 ckio output stn_pwm output t stpwd t stpwd t stpwd t stpwd figure 29.74 stif mo dule signal timing (7)
section 29 electric al characteristics rev. 1.00 nov. 14, 2007 page 1246 of 1262 rej09b0437-0100 29.4.22 ac characteristics measurement conditions ? input/output signal reference levels: v cc q/2 (v cc q = 3.1 to 3.5 v, v cc = 1.1 to 1.3 v) ? input pulse level: v ss q to 3.0 v (where extal, ckio, st1_clkin/ssisck1, st0_clkin/ssisck0, st1_vco_clkin/audio_clk, st0_vco_clkin, res , tres , asemd , testmd , md_bw, md_ck1, md_ck0, nmi, and pb07 to pb00 are within v ss q to v cc q) ? input rise and fall times: 1 ns i ol i oh c l v ref lsi output pin dut output notes: cl is the total value that includes the capacitance of the measuring tools. the individual pins are set as follows. 20 pf: all pins the iol and ioh values are shown in table 29.4. 1. 2. figure 29.75 output load circuit
appendix rev. 1.00 nov. 14, 2007 page 1247 of 1262 rej09b0437-0100 appendix a. pin states pin function pin state type pin name reset state power-down state power-on reset (non-hif boot mode) power-on reset (hif boot mode) software standby sleep h-udi module standby clock extal ex/os* 1 ex/os* 1 xz ex/os* 1 ex/os* 1 xtal o/os* 1 o/os* 1 xz o/os* 1 o/os* 1 ckio i/o/z* 1 * 2 i/o/z* 1 * 2 z i/o/z* 1 * 2 i/o/z* 1 * 2 res i i i i i system control wdtovf h h o o o testmd i i i i i md_bw i i i i i md_ck1 i i i i i operating mode control md_ck0 i i i i i interrupt nmi i i i i i irq[7:0] ? ? i i i address bus a[25:17] ? ? z* 4 o o a[16:0] o o z* 4 o o data bus d[31:0] z z z i/o i/o bus control wait ? ? i i i iois16 ? ? i i i cke z z z* 5 o o cas ras z z z* 5 o o we0 /dqmll z z z* 4 o o we1 /dqmlu/ we z z z* 4 o o we2 /dqmul/ iciord z z z* 4 o o
appendix rev. 1.00 nov. 14, 2007 page 1248 of 1262 rej09b0437-0100 pin function pin state type pin name reset state power-down state power-on reset (non-hif boot mode) power-on reset (hif boot mode) software standby sleep h-udi module standby bus control we3 /dqmuu/ iciowr z z z* 4 o o rd h h z* 4 o o rdwr z z z* 4 o o cs0 h h z* 4 o o ce2b ce2a ? ? z* 4 o o cs6 / ce1b cs5 / ce1a ? ? z* 4 o o cs4 ? ? z* 4 o o cs3 z z z* 4 o o bs ? ? z* 4 o o ether mii_rxd[3:0] ? ? i/z* 3 i i mii_txd[3:0] ? ? o/z* 3 o o rx_dv ? ? i/z* 3 i i rx_er ? ? i/z* 3 i i rx_clk ? ? i/z* 3 i i tx_er ? ? o/z* 3 o o tx_en ? ? o/z* 3 o o tx_clk ? ? i/z* 3 i i col ? ? i/z* 3 i i crs ? ? i/z* 3 i i mdio ? ? i/o/z* 3 i/o i/o mdc ? ? o/z* 3 o o lnksta ? ? i/z* 3 i i exout ? ? o/z* 3 o o wol ? ? o/z* 3 o o usb dp i/o i/o i/o i/o i/o dm i/o i/o i/o i/o i/o vbus i i i i i
appendix rev. 1.00 nov. 14, 2007 page 1249 of 1262 rej09b0437-0100 pin function pin state type pin name reset state power-down state power-on reset (non-hif boot mode) power-on reset (hif boot mode) software standby sleep h-udi module standby usb usb_x1 i i i i i usb_x2 o o o o o stif st_clkout z z o/z* 3 o o st[1:0]_clkin z z i/z* 3 i i st[1:0]_vco_clkin z z i/z* 3 i i st[1:0]_pwm ? ? o/z* 3 o o st[1:0]_syc ? ? i/o/z* 3 i/o i/o st[1:0]_vld ? ? z i/o i/o stif st[1:0]_req ? ? z i/o i/o st[1:0]_d[7:0] ? ? z i/o i/o host-i/f hifebl ? z i/z* 3 i i hifrdy ? l o/z* 3 o o* 6 hifdreq ? z o/z* 3 o o* 6 hifint ? z o/z* 3 o o* 6 hifrd ? z i/z* 3 i i* 6 hifwr ? z i/z* 3 i i* 6 hifrs ? z i/z* 3 i i* 6 hifcs ? z i/z* 3 i i* 6 hifd[15:0] ? z i/o/z* 3 i/o i/o* 6 iic scl ? ? z i/o i/o sda ? ? z i/o i/o ssi audio_clk ? ? i i i ssi_sck[1:0] ? ? k/z* 3 i/o i/o ssi_ws[1:0] ? ? k/z* 3 i/o i/o ssi_data[1:0] ? ? k/z* 3 i/o i/o scif txd[2:0] ? ? o/z* 3 o/z z rxd[2:0] ? ? k/z* 3 i i sck[2:0] ? ? k/z* 3 i/o i rts[2:0] ? ? k/z* 3 i/o i
appendix rev. 1.00 nov. 14, 2007 page 1250 of 1262 rej09b0437-0100 pin function pin state type pin name reset state power-down state power-on reset (non-hif boot mode) power-on reset (hif boot mode) software standby sleep h-udi module standby dmac cts[2:0] ? ? k/z* 3 i/o i/o dack[1:0] ? ? z o o dreq[1:0] ? ? z i i tend[1:0] ? ? z o o sdhi sdclk ? ? o/z* 3 o o sdcmd ? ? k/z* 3 i/o i/o sdcd ? ? z i i sdwp ? ? z i i sddat[3:0] ? ? k/z* 3 i/o i/o h-udi trst pi pi pi pi pi tck i i i i i tms pi pi pi pi pi tdi pi pi pi pi pi tdo z z z z z asebrk / asebrkak i i i i i asemd i i i i i [25] i i k/z* 3 i/o i/o i/o port pa[25:17] [24:17] z z k/z* 3 i/o i/o [01:00] i i i i/o i/o pb[07:00] [07:02] z z k/z* 3 i/o i/o pc[20:00] z z k/z* 3 i/o i/o pd[07:00] i i k/z* 3 i/o i/o pe[11:00] z z k/z* 3 i/o i/o pf[11:00] z z k/z* 3 i/o i/o pg[23:00] z z k/z* 3 i/o i/o
appendix rev. 1.00 nov. 14, 2007 page 1251 of 1262 rej09b0437-0100 [legend] ?: this pin function is never selected as the initial state. i: input o: output ex: external clock input os: oscillated by a crystal oscillator xz: standby state h: high-level output l: low-level output z: high-impedance k: the pin retains its state. pi: input enabled and pull-up state notes: 1. depends on clock mode. 2. depends on the setting of the ckoen bi ts (bits 1 and 0) of the frqcr register. 3. depends on the settings of the ior regist er bits of the general-purpose port and the hiz bit of the stbcr3 register. 4. depends on the hizmem bit of the cmncr register. 5. depends on the hizcnt bit of the cmncr register. 6. high impedance when hifebl is set to the low level.
appendix rev. 1.00 nov. 14, 2007 page 1252 of 1262 rej09b0437-0100 b. product lineup type code catalog code operating temperature chemical composition of solder balls package code r5s76700b200bg r5s76700b200bg -20 to +70 c lead-free prbg0256ga-a r5s76710b200bg r5s76710b200bg -20 to +70 c lead-free prbg0240ga-a r5s76720b200bg r5s76720b200bg -20 to +70 c lead-free prbg0240ga-a r5s76730b200bg r5s76730b200bg -20 to +70 c lead-free prbg0240ga-a r5s76700d133bg r5s76700d133bg -40 to +85 c lead-free prbg0240ga-a r5s76710d133bg r5s76710d133bg -40 to +85 c lead-free prbg0240ga-a r5s76720d133bg r5s76720d133bg -40 to +85 c lead-free prbg0240ga-a r5s76730d133bg r5s76730d133bg -40 to +85 c lead-free prbg0240ga-a
appendix rev. 1.00 nov. 14, 2007 page 1253 of 1262 rej09b0437-0100 c. package dimensions e a 1 max nom min dimension in millimeters symbol reference a b x y 17.0 0.10 0.80 0.45 0.50 0.55 0.35 0.40 0.45 1.90 17.0 0.08 v w 0.9 0.9 y 1 0.2 0.20 0.15 previous code jeita package code renesas code 0.85g mass[typ.] z e z d e d z z s e s d e d p-fbga256-17x17-0.80 prbg0256ga-a 1 1 a a b s s y s wa s wb v s y 1 234567891011121314151617181920 b c d e f g h j k l m n p r t u v w y a a e e b a s b m 4 d e ? figure c.1 package dimensions
appendix rev. 1.00 nov. 14, 2007 page 1254 of 1262 rej09b0437-0100
rev. 1.00 nov. 14, 2007 page 1255 of 1262 rej09b0437-0100 index numerics 16-bit/32-bit displacement ........................ 39 a absolute address....................................... 39 absolute address accessing....................... 39 absolute maximum ratings ................. 1171 ac characteristics ................................ 1181 ac characteristics measurement conditions............................................. 1248 access size and data alignment .............. 217 access wait control................................. 229 accessing mii registers .......................... 430 address array.................................... 88, 102 address array read .................................. 102 address errors......................................... 117 address map ........................................... 174 address multiplexing.............................. 235 address-array write (associative ope ration) ............................ 103 address-array write (non-associative operation)..................... 102 addressing modes..................................... 40 arithmetic operation instructions ............. 59 auto-refreshing....................................... 262 auto-request mode ................................. 323 b bank active ............................................. 255 banked register and input /output of banks ...................................... 162 bit manipulation instructions.................... 70 bit synchronous circuit ........................... 870 branch instructions ................................... 64 break detection and processing .............. 985 break on data acce ss cycle.................... 1076 break on instruction fetch cycle............ 1075 burst mode.............................................. 336 burst read................................................ 247 burst write............................................... 252 bus format for ssi module ..................... 602 bus state controller (bsc) ...................... 169 bus timing ........................................... 1187 bus-released state...................................... 73 c cache ........................................................ 87 calculating exception handling vector table addresses ............................. 112 canceling software standby mode (wdt)..................................................... 369 changing the divi sion ratio ..................... 358 changing the frequency .................. 357, 369 changing the multiplication rate............. 357 clock frequency control circuit............... 345 clock operating modes ........................... 349 clock pulse generator (cpg) .................. 343 clock timing ........................................ 1182 clocked synchronous serial format......... 860 cmcnt count timing ............................. 917 coherency of cache and external memory ..................................... 101 compare match timer (cmt) ................. 911 conditions for determining number of idle cycles ............................................... 285 conflict between byte-write and count-up processes of cmcnt............... 922 conflict between word-write and count-up processes of cmcnt............... 921 conflict between write and compare-match processes of cmcnt .... 920
rev. 1.00 nov. 14, 2007 page 1256 of 1262 rej09b0437-0100 connection to phy-lsi ......................... 435 control signal timing .......................... 1186 cpu .......................................................... 29 crystal osc illator..................................... 345 csn assert period expansion................... 231 cycle steal mode..................................... 334 d data array ......................................... 88, 103 data array read ....................................... 103 data array write ...................................... 103 data format in registers ............................ 34 data formats in memory ........................... 34 data register.......................................... 1039 data transfer instructions.......................... 55 data transfer with interrupt request signals.......................... 166 dc characteristics................................ 1173 deep power-down mode......................... 271 delayed branch instructions ..................... 37 denormalized numbers............................. 80 direct memory access controller (dmac) ................................................. 293 displacement accessing............................ 39 divider 1................................................. 345 divider 2................................................. 345 dma transfer flowchart ......................... 322 dmac module timing ........................ 1216 dmac that works with encryption/decryption and forward error correction core (a-dmac) ......... 493 dreq pin sampling timing .................... 339 dual address mode.................................. 331 e effective address calculation .................... 40 electrical charact eristics ...................... 1171 endian..................................................... 217 equation for getting scbrr value......... 945 etherc module signal timing.............. 1233 etherc receiver ....................................... 427 etherc transmitter................................... 425 ethernet controller (etherc) ................... 395 ethernet controller direct memory access controller (e-dmac) .................. 437 exception handling ................................. 107 exception hand ling state ........................... 73 exception handling vector table.............. 111 exception source generation immediately after delayed branch instruction.............. 127 exceptions triggered by instructions....... 123 external request mode............................. 323 f fixed mode ............................................. 327 floating-point exceptions.......................... 85 floating-point format ................................ 76 floating-point operation instruction........ 126 floating-point operation instructions ........ 67 floating-point ranges ................................ 78 floating-point registers ............................. 81 floating-point unit (fpu) ......................... 75 flow control............................................ 434 format of double-precision floating-point number ............................... 76 format of single-precision foating-point number ................................ 76 fpu exception handling............................ 86 fpu exception sources.............................. 85 fpu-related cpu instructions................... 69 g general illegal in structions ..................... 124 general registers ....................................... 29 global base register (gbr)....................... 31
rev. 1.00 nov. 14, 2007 page 1257 of 1262 rej09b0437-0100 h hif module signal timing .................. 1230 high-performance user debugging interface (h-u di) ................................. 1083 host interface (hif)................................ 875 h-udi commands................................. 1086 h-udi interrupt ............................ 143, 1090 h-udi reset .......................................... 1090 h-udi-related pin timing .................. 1237 i i/o port timing .................................... 1229 i/o ports................................................ 1039 i 2 c bus format......................................... 851 i 2 c bus interface 3 (iic3) ....................... 833 iic3 module timing............................. 1220 immediate data ......................................... 38 immediate data accessing ......................... 38 immediate data format.............................. 35 initial values of control registers .............. 33 initial values of general registers .............. 33 initial values of system registers............... 33 instruction features ................................... 36 instruction format ..................................... 45 instruction set ........................................... 49 integer division instructions ................... 125 interrupt controller (intc)..................... 131 interrupt excepti on handling................... 122 interrupt exception handling vectors an d priorities................ 147 interrupt priority level............................. 121 interrupt response time ........................... 155 irq interrupts ......................................... 144 j jump table base register (tbr) ................ 31 l load-store architecture ............................. 36 logic operation instructions...................... 62 low-power sdram............................... 269 lru .......................................................... 89 m magic packet detection ........................... 433 manual reset............................................ 116 master receive operation......................... 854 master transmit operation ....................... 852 memory-mapped cache........................... 102 mii frame timing..................................... 428 module standby function ........................ 393 multi-buffer frame transmit /receive pro cessing.................................. 485 multiplexed pin ....................................... 987 multiply and accumulate register high (mach)............................................ 32 multiply and accumulate register low (macl) ............................................. 32 multiply/multiply-and-accumulate operations.................................................. 37 n nmi interrupt.......................................... 143 noise filter .............................................. 864 non-compressed modes .......................... 603 non-numbers (nan) ................................. 79 normal space interface ........................... 224 note on inputting external clock ............. 359 note on resonator.................................... 360 note on using a pll oscillation circuit..................................... 360 note on using an external crystal resonator ...................................... 359
rev. 1.00 nov. 14, 2007 page 1258 of 1262 rej09b0437-0100 o on-chip peripheral module interrupts..... 145 on-chip peripheral module request ........ 325 on-chip ram....................................... 1093 operation by ipg setting ........................ 434 operation in asynch ronous mode ........... 963 operation in clocked synchronous mode .................................. 974 output addition circuit........................ 1248 p package..................................................... 11 padding receive data............................. 487 page conflict ......................................... 1094 pcmcia interface.................................. 277 pin assignments ........................................ 13 pin function contro ller (pfc) ................. 987 pin functions............................................. 14 pll circuit.............................................. 345 power-down mode.................................. 266 power-down modes ................................ 375 power-down state ..................................... 73 power-on reset ........................................ 114 power-on sequence ................................. 267 power-on/power-off sequence ............. 1172 prefetch operation (only for oper and cache)........................... 98 procedure register (pr) ............................ 32 program counter (pc)............................... 32 program execution state............................ 73 r receive data sampling timing and receive margin (async hronous mode) ..... 985 receive descriptor 0 (rd0) .................... 476 receive descriptor 1 (rd1) .................... 480 receive descriptor 2 (rd2) .................... 480 registers ackeyr............................................ 213 acswr .............................................. 212 apr..................................................... 422 bamr............................................... 1067 bar .................................................. 1066 bbr .................................................. 1070 bdmr............................................... 1069 bdr .................................................. 1068 bempenb ......................................... 673 bempsts........................................... 691 brcr................................................ 1072 brdyenb ......................................... 669 brdysts .......................................... 688 buswait .......................................... 639 ccr1 .................................................... 90 ccr2 .................................................... 92 cdcr ................................................. 412 cefcr................................................ 415 cfifo ................................................. 652 cfifoctr ......................................... 661 cfifosel.......................................... 654 chcr ................................................. 303 cmcnt .............................................. 916 cmcor.............................................. 916 cmcsr............................................... 914 cmncr.............................................. 177 cmstr............................................... 913 cnc ..................................................... 499 cnd0................................................... 507 cnd1................................................... 513 cnd2................................................... 514 cnd3................................................... 514 cnd4................................................... 516 cndca ............................................... 506 cndcr............................................... 414 cndsa................................................ 505 cni ...................................................... 503 cnm .................................................... 502 cs0wcr ............................................ 184
rev. 1.00 nov. 14, 2007 page 1259 of 1262 rej09b0437-0100 cs3wcr .................................... 18 7, 197 cs4wcr ............................................ 189 cs5wcr .................................... 19 2, 201 cs6wcr .................................... 19 4, 201 csnbcr (n = 0, 3 to 6) ...................... 179 d0fbcfg........................................... 651 d0fifo............................................... 652 d0fifoctr....................................... 661 d0fifosel........................................ 654 d0fwait........................................... 757 d1fbcfg........................................... 651 d1fifo............................................... 652 d1fifoctr....................................... 661 d1fifosel........................................ 654 d1fwait........................................... 757 dar.................................................... 302 dcpcfg............................................. 702 dcpctr............................................. 704 dcpmaxp......................................... 703 devaddn ......................................... 754 dmaor ............................................. 315 dmars0 to dmars3....................... 319 dmatcr ........................................... 302 dvstctr .......................................... 642 ecmr................................................. 400 ecsipr............................................... 405 ecsr .................................................. 403 edmr................................................. 439 edocr............................................... 459 edrrr............................................... 442 edtrr ............................................... 441 eesipr............................................... 450 eesr .................................................. 445 fcftr................................................ 462 fdr .................................................... 457 fpscr .................................................. 82 fpul .................................................... 83 frecr ............................................... 416 frmnum .......................................... 692 frqcr ............................................... 354 hifadr.............................................. 890 hifbcr .............................................. 891 hifbicr............................................. 894 hifdata........................................... 891 hifdtr .............................................. 893 hifeicr............................................. 889 hifgsr .............................................. 882 hifidx............................................... 880 hifiicr .............................................. 888 hifmcr ............................................. 886 hifscr .............................................. 883 ibcr ................................................... 141 ibmpr ................................................ 215 ibnr................................................... 142 iccr1 ................................................. 836 iccr2 ................................................. 839 icdrr ................................................ 849 icdrs................................................. 849 icdrt ................................................ 848 icier .................................................. 843 icmr .................................................. 841 icr0.................................................... 137 icr1.................................................... 138 icsr.................................................... 845 intenb0............................................ 665 intenb1............................................ 667 intsts0............................................. 677 intsts1............................................. 682 ipgr ................................................... 421 ipr01, ipr02, ipr06 to ipr16........... 135 irqrr ................................................ 139 lccr .................................................. 413 mafcr .............................................. 420 mahr ................................................ 407 malr................................................. 408 mpr .................................................... 423 nf2cyc ............................................. 850 nrdyenb ......................................... 671 nrdysts .......................................... 689 pacrh1 ........................................... 1005
rev. 1.00 nov. 14, 2007 page 1260 of 1262 rej09b0437-0100 pacrh2........................................... 1005 padrh ............................................ 1040 paiorh ........................................... 1004 pbcrl1 ........................................... 1009 pbcrl2 ........................................... 1009 pbdrl ............................................. 1043 pbiorl............................................ 1008 pccrh2 ........................................... 1012 pccrl1 ........................................... 1012 pccrl2 ........................................... 1012 pcdrh............................................. 1046 pcdrl ............................................. 1046 pciorh ........................................... 1011 pciorl............................................ 1011 pdcrl2 ........................................... 1019 pddrl ............................................. 1050 pdiorl............................................ 1018 pecrl1............................................ 1022 pecrl2............................................ 1022 pedrl ............................................. 1053 peiorl ............................................ 1021 pfcrl1............................................ 1027 pfcrl2............................................ 1027 pfdrl.............................................. 1056 pfiorl ............................................ 1026 pgcrl1 ........................................... 1032 pgcrl2 ........................................... 1032 pgdrl ............................................. 1059 pgiorl............................................ 1031 pipebuf ............................................ 723 pipecfg ............................................ 716 pipemaxp ........................................ 726 pipenctr .......................................... 730 pipentre .......................................... 750 pipentrn.......................................... 752 pipeperi ........................................... 728 pipesel............................................. 714 pir...................................................... 406 psr..................................................... 410 rbwar ............................................. 460 rdar ................................................. 313 rdfar ............................................... 461 rdlar............................................... 444 rdmatcr......................................... 314 rfcr .................................................. 419 rflr .................................................. 409 rmcr................................................. 458 rmfcr............................................... 455 rsar.................................................. 312 rtcnt ............................................... 210 rtcor ............................................... 211 rtcsr................................................ 208 sar (dmac) ..................................... 301 sar (iic3).......................................... 848 scbrr ............................................... 945 scfcr................................................ 952 scfdr................................................ 955 scfrdr ............................................. 928 scfsr ................................................ 937 scftdr ............................................. 929 sclsr ................................................ 959 scrsr................................................ 928 scscr................................................ 933 scsmr ............................................... 930 scsptr.............................................. 956 scsr................................................... 601 sctsr ................................................ 929 sdbpr.............................................. 1085 sdcr.................................................. 205 sdir ................................................. 1086 sofcfg ............................................. 675 ssicr ................................................. 589 ssirdr .............................................. 600 ssisr.................................................. 595 ssitdr............................................... 600 stbcr................................................ 377 stbcr2.............................................. 378 stbcr3.............................................. 380 stbcr4.............................................. 382 stcntcr .......................................... 552
rev. 1.00 nov. 14, 2007 page 1261 of 1262 rej09b0437-0100 stcntvr .......................................... 553 stctlr ............................................. 550 stdbgr ............................................ 570 stier ................................................. 557 stlkcr............................................. 567 stmdr .............................................. 547 stpcr0r ........................................... 565 stpcr1r ........................................... 565 stpwmcr......................................... 562 stpwmmr........................................ 558 stpwmr ........................................... 564 ststc0r ........................................... 566 ststc1r ........................................... 566 ststr ................................................ 553 syscfg ............................................. 635 syscr1 ............................................. 384 syscr2 ............................................. 386 syscr3 ............................................. 388 syssts.............................................. 640 tbrar............................................... 461 tdfar ............................................... 462 tdlar............................................... 443 testmode....................................... 648 tftr .................................................. 456 tier ................................................... 556 tlfrcr ............................................. 418 tpauser .......................................... 424 trimd ............................... 465, 467, 468 trocr............................................... 411 trscer ............................................. 453 tsfrcr ............................................. 417 ufrmnum........................................ 695 usbaddr ......................................... 696 usbindx .......................................... 700 usbleng.......................................... 701 usbreq ............................................ 697 usbval ............................................ 699 wrcsr .............................................. 366 wtcnt .............................................. 363 wtcsr .............................................. 364 registers bank error exception handling .......................... 119, 165 registers bank errors............................... 119 registers bank exception ........................ 165 registers banks ................................. 33, 161 relationship between access size and number of bursts............................... 247 relationship between refresh requests and bus cy cles ......................................... 265 reset state ................................................. 73 restoration from bank............................. 163 restoration from stack ............................ 164 risc-type instruction set .......................... 36 round to nearest ....................................... 84 rounding................................................... 84 round-robin mode .................................. 327 s saving to bank ........................................ 162 saving to stack ........................................ 164 scif interrupt sources ............................ 983 scif module timing............................ 1218 sd host interface (sdhi)........................ 831 sdhi module timing ........................... 1227 sdram interface ................................... 232 searching cache ........................................ 96 self-refreshing ........................................ 264 sending a break signal ............................ 985 sequence to write to acswr................. 214 serial bit cloc k control ............................ 621 serial communication interface with fifo (scif)............................................ 923 serial sound interface (ssi) ................... 585 shift instructions ....................................... 63 sign extension of word data...................... 36 single address mode ............................... 333 single read .............................................. 251 single write ............................................. 254 slave receive op eration ........................... 859
rev. 1.00 nov. 14, 2007 page 1262 of 1262 rej09b0437-0100 slave transmit operation ......................... 856 sleep mode ............................................. 389 slot illegal inst ructions ........................... 124 software standby mode .......................... 390 sram interface with byte selection....... 272 ssi module timing .............................. 1222 stack after interrupt exception handling.................................. 154 stack status after exception handling ends ......................... 128 standby control circuit............................ 346 status register (sr)................................... 30 stif modulesignal timing.................. 1239 supported dma transfers....................... 330 system control instructions ...................... 65 t t bit .......................................................... 37 tap controller ...................................... 1087 tdo output timing ............................... 1089 timing to clear an interrupt source......... 168 transceiver timing............................... 1225 transfer rate............................................ 838 transmit descriptor 0 (td0)................... 471 transmit descriptor 1 (td1)................... 474 transmit descriptor 2 (td2)................... 474 trap instructions ..................................... 124 types of exception handling and priority order ........................................... 107 u unconditional branch instructions with no delay slot.............................................. 37 usb 2.0 host/function module (usb) .... 623 user break controller (ubc)................. 1063 user break interrupt ................................ 143 using interval timer mode ...................... 372 using watchdog timer mode ................... 370 v vector base register (vbr)....................... 31 w wait between access cycles .................... 284 watchdog timer (wdt).......................... 361 watchdog timer timing....................... 1217 write-back buffer (only for oper and cache) ........................... 99
renesas 32-bit risc microcomputer hardware manual SH7670 group publication date: rev.1.00, nov. 14, 2007 published by: sales strategic planning div. renesas technology corp. edited by: customer support department global strategic communication div. renesas solutions corp. ? 2007. renesas technology corp., all rights reserved. printed in japan.
sales strategic planning div. nippon bldg., 2-6-2, ohte-machi, chiyoda-ku, tokyo 100-0004, japan http://www.renesas.com refer to " http://www.renesas.com/en/network " for the latest and detailed information. renesas technology america, inc. 450 holger way, san jose, ca 95134-1368, u.s.a tel: <1> (408) 382-7500, fax: <1> (408) 382-7501 renesas technology europe limited dukes meadow, millboard road, bourne end, buckinghamshire, sl8 5fh, u.k. tel: <44> (1628) 585-100, fax: <44> (1628) 585-900 renesas technology (shanghai) co., ltd. unit 204, 205, aziacenter, no.1233 lujiazui ring rd, pudong district, shanghai, china 200120 tel: <86> (21) 5877-1818, fax: <86> (21) 6887-7898 renesas technology hong kong ltd. 7th floor, north tower, world finance centre, harbour city, 1 canton road, tsimshatsui, kowloon, hong kong tel: <852> 2265-6688, fax: <852> 2730-6071 renesas technology taiwan co., ltd. 10th floor, no.99, fushing north road, taipei, taiwan tel: <886> (2) 2715-2888, fax: <886> (2) 2713-2999 renesas technology singapore pte. ltd. 1 harbour front avenue, #06-10, keppel bay tower, singapore 098632 tel: <65> 6213-0200, fax: <65> 6278-8001 renesas technology korea co., ltd. kukje center bldg. 18th fl., 191, 2-ka, hangang-ro, yongsan-ku, seoul 140-702, korea tel: <82> (2) 796-3115, fax: <82> (2) 796-2145 renesas technology malaysia sdn. bhd unit 906, block b, menara amcorp, amcorp trade centre, no.18, jalan persiaran barat, 46050 petaling jaya, selangor darul ehsan, malaysia tel: <603> 7955-9390, fax: <603> 7955-9510 renesas sales offices colophon 6.0

SH7670 group hardware manual


▲Up To Search▲   

 
Price & Availability of SH7670

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X